mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 03:41:06 +07:00
Update Node.js dependenices
Remove semver override Bump version to 2.25.5
This commit is contained in:
parent
5b2015e8fe
commit
72ae4ccbe5
140
dist/index.js
vendored
140
dist/index.js
vendored
@ -4389,6 +4389,43 @@ function copyFile(srcFile, destFile, force) {
|
||||
0;
|
||||
})(this, (function (exports) { 'use strict';
|
||||
|
||||
const semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
|
||||
const validateAndParse = (version) => {
|
||||
if (typeof version !== 'string') {
|
||||
throw new TypeError('Invalid argument expected string');
|
||||
}
|
||||
const match = version.match(semver);
|
||||
if (!match) {
|
||||
throw new Error(`Invalid argument not valid semver ('${version}' received)`);
|
||||
}
|
||||
match.shift();
|
||||
return match;
|
||||
};
|
||||
const isWildcard = (s) => s === '*' || s === 'x' || s === 'X';
|
||||
const tryParse = (v) => {
|
||||
const n = parseInt(v, 10);
|
||||
return isNaN(n) ? v : n;
|
||||
};
|
||||
const forceType = (a, b) => typeof a !== typeof b ? [String(a), String(b)] : [a, b];
|
||||
const compareStrings = (a, b) => {
|
||||
if (isWildcard(a) || isWildcard(b))
|
||||
return 0;
|
||||
const [ap, bp] = forceType(tryParse(a), tryParse(b));
|
||||
if (ap > bp)
|
||||
return 1;
|
||||
if (ap < bp)
|
||||
return -1;
|
||||
return 0;
|
||||
};
|
||||
const compareSegments = (a, b) => {
|
||||
for (let i = 0; i < Math.max(a.length, b.length); i++) {
|
||||
const r = compareStrings(a[i] || '0', b[i] || '0');
|
||||
if (r !== 0)
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.
|
||||
* This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`.
|
||||
@ -4416,20 +4453,7 @@ function copyFile(srcFile, destFile, force) {
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
/**
|
||||
* Validate [semver](https://semver.org/) version strings.
|
||||
*
|
||||
* @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 validate = (version) => typeof version === 'string' && /^[v\d]/.test(version) && semver.test(version);
|
||||
|
||||
/**
|
||||
* Compare [semver](https://semver.org/) version strings using the specified operator.
|
||||
*
|
||||
@ -4455,6 +4479,24 @@ function copyFile(srcFile, destFile, force) {
|
||||
const res = compareVersions(v1, v2);
|
||||
return operatorResMap[operator].includes(res);
|
||||
};
|
||||
const operatorResMap = {
|
||||
'>': [1],
|
||||
'>=': [0, 1],
|
||||
'=': [0],
|
||||
'<=': [-1, 0],
|
||||
'<': [-1],
|
||||
'!=': [-1, 1],
|
||||
};
|
||||
const allowedOperators = Object.keys(operatorResMap);
|
||||
const assertValidOperator = (op) => {
|
||||
if (typeof op !== 'string') {
|
||||
throw new TypeError(`Invalid operator type, expected string but got ${typeof op}`);
|
||||
}
|
||||
if (allowedOperators.indexOf(op) === -1) {
|
||||
throw new Error(`Invalid operator, expected one of ${allowedOperators.join('|')}`);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Match [npm semver](https://docs.npmjs.com/cli/v6/using-npm/semver) version range.
|
||||
*
|
||||
@ -4469,6 +4511,8 @@ function copyFile(srcFile, destFile, force) {
|
||||
* ```
|
||||
*/
|
||||
const satisfies = (version, range) => {
|
||||
// clean input
|
||||
range = range.replace(/([><=]+)\s+/g, '$1');
|
||||
// handle multiple comparators
|
||||
if (range.includes('||')) {
|
||||
return range.split('||').some((r) => satisfies(version, r));
|
||||
@ -4516,59 +4560,21 @@ function copyFile(srcFile, destFile, force) {
|
||||
return false;
|
||||
return true;
|
||||
};
|
||||
const semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
|
||||
const validateAndParse = (version) => {
|
||||
if (typeof version !== 'string') {
|
||||
throw new TypeError('Invalid argument expected string');
|
||||
}
|
||||
const match = version.match(semver);
|
||||
if (!match) {
|
||||
throw new Error(`Invalid argument not valid semver ('${version}' received)`);
|
||||
}
|
||||
match.shift();
|
||||
return match;
|
||||
};
|
||||
const isWildcard = (s) => s === '*' || s === 'x' || s === 'X';
|
||||
const tryParse = (v) => {
|
||||
const n = parseInt(v, 10);
|
||||
return isNaN(n) ? v : n;
|
||||
};
|
||||
const forceType = (a, b) => typeof a !== typeof b ? [String(a), String(b)] : [a, b];
|
||||
const compareStrings = (a, b) => {
|
||||
if (isWildcard(a) || isWildcard(b))
|
||||
return 0;
|
||||
const [ap, bp] = forceType(tryParse(a), tryParse(b));
|
||||
if (ap > bp)
|
||||
return 1;
|
||||
if (ap < bp)
|
||||
return -1;
|
||||
return 0;
|
||||
};
|
||||
const compareSegments = (a, b) => {
|
||||
for (let i = 0; i < Math.max(a.length, b.length); i++) {
|
||||
const r = compareStrings(a[i] || '0', b[i] || '0');
|
||||
if (r !== 0)
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
const operatorResMap = {
|
||||
'>': [1],
|
||||
'>=': [0, 1],
|
||||
'=': [0],
|
||||
'<=': [-1, 0],
|
||||
'<': [-1],
|
||||
'!=': [-1, 1],
|
||||
};
|
||||
const allowedOperators = Object.keys(operatorResMap);
|
||||
const assertValidOperator = (op) => {
|
||||
if (typeof op !== 'string') {
|
||||
throw new TypeError(`Invalid operator type, expected string but got ${typeof op}`);
|
||||
}
|
||||
if (allowedOperators.indexOf(op) === -1) {
|
||||
throw new Error(`Invalid operator, expected one of ${allowedOperators.join('|')}`);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Validate [semver](https://semver.org/) version strings.
|
||||
*
|
||||
* @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 validate = (version) => typeof version === 'string' && /^[v\d]/.test(version) && semver.test(version);
|
||||
|
||||
exports.compare = compare;
|
||||
exports.compareVersions = compareVersions;
|
||||
|
3331
package-lock.json
generated
3331
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
35
package.json
35
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "setup-php",
|
||||
"version": "2.25.4",
|
||||
"version": "2.25.5",
|
||||
"private": false,
|
||||
"description": "Setup PHP for use with GitHub Actions",
|
||||
"main": "lib/install.js",
|
||||
@ -37,30 +37,27 @@
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/io": "^1.1.3",
|
||||
"compare-versions": "^6.0.0-rc.2"
|
||||
"compare-versions": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.2",
|
||||
"@types/node": "^20.3.3",
|
||||
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
||||
"@typescript-eslint/parser": "^5.60.1",
|
||||
"@types/jest": "^29.5.3",
|
||||
"@types/node": "^20.4.5",
|
||||
"@typescript-eslint/eslint-plugin": "^6.2.0",
|
||||
"@typescript-eslint/parser": "^6.2.0",
|
||||
"@vercel/ncc": "^0.36.1",
|
||||
"eslint": "^8.44.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-jest": "^27.2.2",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"jest": "^29.5.0",
|
||||
"jest-circus": "^29.5.0",
|
||||
"nock": "^13.3.1",
|
||||
"prettier": "^2.8.8",
|
||||
"simple-git-hooks": "^2.8.1",
|
||||
"eslint": "^8.46.0",
|
||||
"eslint-config-prettier": "^8.9.0",
|
||||
"eslint-plugin-import": "^2.28.0",
|
||||
"eslint-plugin-jest": "^27.2.3",
|
||||
"eslint-plugin-prettier": "^5.0.0",
|
||||
"jest": "^29.6.2",
|
||||
"jest-circus": "^29.6.2",
|
||||
"nock": "^13.3.2",
|
||||
"prettier": "^3.0.0",
|
||||
"simple-git-hooks": "^2.9.0",
|
||||
"ts-jest": "^29.1.1",
|
||||
"typescript": "^5.1.6"
|
||||
},
|
||||
"overrides": {
|
||||
"semver": "7.5.3"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/shivammathur/setup-php/issues"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user