Update Node.js dependencies

This commit is contained in:
Shivam Mathur
2023-08-25 04:25:04 +05:30
parent 36e04fc85c
commit 7af6c0fe6f
3 changed files with 955 additions and 924 deletions

16
dist/index.js vendored
View File

@ -4592,11 +4592,27 @@ function copyFile(srcFile, destFile, force) {
* ```
*/
const validate = (version) => typeof version === 'string' && /^[v\d]/.test(version) && semver.test(version);
/**
* Validate [semver](https://semver.org/) version strings strictly. Will not accept wildcards and version ranges.
*
* @param version Version number to validate
* @returns `true` if the version number is a valid semver version number `false` otherwise
*
* @example
* ```
* validate('1.0.0-rc.1'); // return true
* validate('1.0-rc.1'); // return false
* validate('foo'); // return false
* ```
*/
const validateStrict = (version) => typeof version === 'string' &&
/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/.test(version);
exports.compare = compare;
exports.compareVersions = compareVersions;
exports.satisfies = satisfies;
exports.validate = validate;
exports.validateStrict = validateStrict;
}));
//# sourceMappingURL=index.js.map