mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-08-01 19:27:57 +07:00
Update Node.js dependencies
This commit is contained in:
16
dist/index.js
vendored
16
dist/index.js
vendored
@ -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
|
||||
|
Reference in New Issue
Block a user