-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(npm): removes unused run scripts from published manifest
- Loading branch information
Showing
11 changed files
with
99 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,41 @@ | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
var __importDefault = | ||
(this && this.__importDefault) || | ||
function (mod) { | ||
return mod && mod.__esModule ? mod : { default: mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const path_1 = __importDefault(require("path")); | ||
const node_path_1 = __importDefault(require("node:path")); | ||
const satisfies_1 = __importDefault(require("semver/functions/satisfies")); | ||
const coerce_1 = __importDefault(require("semver/functions/coerce")); | ||
const extract_root_module_name_1 = __importDefault(require("./extract-root-module-name")); | ||
const extract_root_module_name_1 = __importDefault( | ||
require("./extract-root-module-name"), | ||
); | ||
function getVersion(pModuleName) { | ||
return require(path_1.default.join((0, extract_root_module_name_1.default)(pModuleName), "package.json")) | ||
.version; | ||
return require( | ||
node_path_1.default.join( | ||
(0, extract_root_module_name_1.default)(pModuleName), | ||
"package.json", | ||
), | ||
).version; | ||
} | ||
function tryRequire(pModuleName, pSemanticVersion) { | ||
try { | ||
if (pSemanticVersion) { | ||
const lVersion = getVersion(pModuleName); | ||
const lCoerced = (0, coerce_1.default)(lVersion); | ||
if (lVersion && | ||
lCoerced && | ||
!(0, satisfies_1.default)(lCoerced.version, pSemanticVersion)) { | ||
return false; | ||
} | ||
} | ||
return require(pModuleName); | ||
} | ||
catch (pError) { | ||
return false; | ||
} | ||
try { | ||
if (pSemanticVersion) { | ||
const lVersion = getVersion(pModuleName); | ||
const lCoerced = (0, coerce_1.default)(lVersion); | ||
if ( | ||
lVersion && | ||
lCoerced && | ||
!(0, satisfies_1.default)(lCoerced.version, pSemanticVersion) | ||
) { | ||
return false; | ||
} | ||
} | ||
return require(pModuleName); | ||
} catch (pError) { | ||
return false; | ||
} | ||
} | ||
exports.default = tryRequire; | ||
module.exports = tryRequire; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters