@lazy-node/semver-ampersand 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/lib/comparator/detect.js +2 -3
- package/lib/comparator/detect.js.map +1 -1
- package/lib/handleAmpersandAndSpaces.js +1 -2
- package/lib/handleAmpersandAndSpaces.js.map +1 -1
- package/lib/internal/parseOptionsOrLoose.js +1 -2
- package/lib/internal/parseOptionsOrLoose.js.map +1 -1
- package/lib/maxSatisfying.js +1 -2
- package/lib/maxSatisfying.js.map +1 -1
- package/lib/minSatisfying.js +1 -2
- package/lib/minSatisfying.js.map +1 -1
- package/lib/range/buildRangeSet.js +1 -2
- package/lib/range/buildRangeSet.js.map +1 -1
- package/lib/range/fixComparatorSet.js +4 -5
- package/lib/range/fixComparatorSet.js.map +1 -1
- package/lib/range/normalizeRangeInput.js +1 -2
- package/lib/range/normalizeRangeInput.js.map +1 -1
- package/lib/range/options.js +3 -4
- package/lib/range/options.js.map +1 -1
- package/lib/range/parseRange.js +6 -7
- package/lib/range/parseRange.js.map +1 -1
- package/lib/range/stringifyRangeSet.js +1 -2
- package/lib/range/stringifyRangeSet.js.map +1 -1
- package/lib/range/toRangeString.js +1 -2
- package/lib/range/toRangeString.js.map +1 -1
- package/lib/range/util.js +11 -12
- package/lib/range/util.js.map +1 -1
- package/lib/satisfies.js +1 -2
- package/lib/satisfies.js.map +1 -1
- package/lib/simplifyRange.js +1 -2
- package/lib/simplifyRange.js.map +1 -1
- package/lib/util/array.js +1 -2
- package/lib/util/array.js.map +1 -1
- package/lib/util/assert.js +3 -4
- package/lib/util/assert.js.map +1 -1
- package/lib/util/fixBooleanProperty.js +2 -2
- package/lib/util/fixBooleanProperty.js.map +1 -1
- package/lib/util/index.js +2 -3
- package/lib/util/index.js.map +1 -1
- package/lib/util/stringifyComparators.js +2 -3
- package/lib/util/stringifyComparators.js.map +1 -1
- package/lib/validRange.js +1 -2
- package/lib/validRange.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.0.2](https://github.com/bluelovers/ws-yarn-workspaces/compare/@lazy-node/semver-ampersand@3.0.1...@lazy-node/semver-ampersand@3.0.2) (2024-05-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### 🛠 Build System
|
|
11
|
+
|
|
12
|
+
* update typescript ([ffa656a](https://github.com/bluelovers/ws-yarn-workspaces/commit/ffa656aefe53966db445d52234eb0efe4651e3dd))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### 📌 Dependencies
|
|
16
|
+
|
|
17
|
+
* update deps ([f731d88](https://github.com/bluelovers/ws-yarn-workspaces/commit/f731d88db6e63d180e2db2e493beb42e84eb8e16))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
6
21
|
## [3.0.1](https://github.com/bluelovers/ws-yarn-workspaces/compare/@lazy-node/semver-ampersand@3.0.0...@lazy-node/semver-ampersand@3.0.1) (2024-02-28)
|
|
7
22
|
|
|
8
23
|
|
package/lib/comparator/detect.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isNullSet = isNullSet;
|
|
4
|
+
exports.isAny = isAny;
|
|
4
5
|
function isNullSet(c) {
|
|
5
6
|
return c.value === "<0.0.0-0" /* EnumSemverVersion.NULL */;
|
|
6
7
|
}
|
|
7
|
-
exports.isNullSet = isNullSet;
|
|
8
8
|
function isAny(c) {
|
|
9
9
|
return c.value === "" /* EnumSemverVersion.ANY */;
|
|
10
10
|
}
|
|
11
|
-
exports.isAny = isAny;
|
|
12
11
|
//# sourceMappingURL=detect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect.js","sourceRoot":"","sources":["detect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"detect.js","sourceRoot":"","sources":["detect.ts"],"names":[],"mappings":";;AAGA,8BAKC;AAED,sBAKC;AAZD,SAAgB,SAAS,CAAuB,CAAI;IAInD,OAAO,CAAC,CAAC,KAAK,4CAA2B,CAAC;AAC3C,CAAC;AAED,SAAgB,KAAK,CAAuB,CAAI;IAI/C,OAAO,CAAC,CAAC,KAAK,mCAA0B,CAAC;AAC1C,CAAC","sourcesContent":["import Comparator from 'semver/classes/comparator';\nimport { EnumSemverVersion } from '../const';\n\nexport function isNullSet<T extends Comparator>(c: T): c is T & {\n\tvalue: '<0.0.0-0'\n}\n{\n\treturn c.value === EnumSemverVersion.NULL;\n}\n\nexport function isAny<T extends Comparator>(c: T): c is T & {\n\tvalue: ''\n}\n{\n\treturn c.value === EnumSemverVersion.ANY;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleAmpersandAndSpaces =
|
|
3
|
+
exports.handleAmpersandAndSpaces = handleAmpersandAndSpaces;
|
|
4
4
|
const const_1 = require("./const");
|
|
5
5
|
function handleAmpersandAndSpaces(versionRange, options) {
|
|
6
6
|
if (typeof versionRange === 'string') {
|
|
@@ -8,6 +8,5 @@ function handleAmpersandAndSpaces(versionRange, options) {
|
|
|
8
8
|
}
|
|
9
9
|
return versionRange;
|
|
10
10
|
}
|
|
11
|
-
exports.handleAmpersandAndSpaces = handleAmpersandAndSpaces;
|
|
12
11
|
exports.default = handleAmpersandAndSpaces;
|
|
13
12
|
//# sourceMappingURL=handleAmpersandAndSpaces.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleAmpersandAndSpaces.js","sourceRoot":"","sources":["handleAmpersandAndSpaces.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handleAmpersandAndSpaces.js","sourceRoot":"","sources":["handleAmpersandAndSpaces.ts"],"names":[],"mappings":";;AAGA,4DAQC;AAXD,mCAAyD;AAGzD,SAAgB,wBAAwB,CAAI,YAAe,EAAE,OAAkB;IAE9E,IAAI,OAAO,YAAY,KAAK,QAAQ,EACpC,CAAC;QACA,OAAO,YAAY,CAAC,OAAO,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,gBAAQ,CAAC,CAAC,CAAC,4BAAoB,EAAE,GAAG,CAAC,CAAC,IAAI,EAAS,CAAA;IACvG,CAAC;IAED,OAAO,YAAY,CAAA;AACpB,CAAC;AAED,kBAAe,wBAAwB,CAAA","sourcesContent":["import { reAmpersandAndSpaces, reSpaces } from './const';\nimport { IOptions } from './types';\n\nexport function handleAmpersandAndSpaces<T>(versionRange: T, options?: IOptions): T\n{\n\tif (typeof versionRange === 'string')\n\t{\n\t\treturn versionRange.replace(options?.noAmpersand ? reSpaces : reAmpersandAndSpaces, ' ').trim() as any\n\t}\n\n\treturn versionRange\n}\n\nexport default handleAmpersandAndSpaces\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseOptionsOrLoose =
|
|
3
|
+
exports.parseOptionsOrLoose = parseOptionsOrLoose;
|
|
4
4
|
const index_1 = require("../util/index");
|
|
5
5
|
const fixBooleanProperty_1 = require("../util/fixBooleanProperty");
|
|
6
6
|
function parseOptionsOrLoose(options) {
|
|
@@ -22,5 +22,4 @@ function parseOptionsOrLoose(options) {
|
|
|
22
22
|
}
|
|
23
23
|
return options;
|
|
24
24
|
}
|
|
25
|
-
exports.parseOptionsOrLoose = parseOptionsOrLoose;
|
|
26
25
|
//# sourceMappingURL=parseOptionsOrLoose.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseOptionsOrLoose.js","sourceRoot":"","sources":["parseOptionsOrLoose.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parseOptionsOrLoose.js","sourceRoot":"","sources":["parseOptionsOrLoose.ts"],"names":[],"mappings":";;AAIA,kDAwBC;AA3BD,yCAA8C;AAC9C,mEAAsE;AAEtE,SAAgB,mBAAmB,CAAqB,OAA2B;IAElF,IAAI,OAAO,KAAK,KAAK,EACrB,CAAC;QACA,OAAO,GAAG;YACT,KAAK,EAAE,CAAC,CAAC,OAAO;SACX,CAAC;IACR,CAAC;SACI,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,IAAA,qBAAa,EAAC,OAAO,CAAC,EAC3E,CAAC;QACA,OAAO,GAAG,EAAO,CAAC;IACnB,CAAC;SACI,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,IAAA,qBAAa,EAAC,OAAO,CAAC,EAC/D,CAAC;QACA,OAAO,GAAG;YACT,KAAK,EAAE,CAAC,CAAC,OAAO;SACX,CAAC;IACR,CAAC;SAED,CAAC;QACA,OAAO,GAAG,IAAA,uCAAkB,EAAC,OAAO,EAAE,yBAAI,CAAC,CAAA;IAC5C,CAAC;IAED,OAAO,OAAO,CAAA;AACf,CAAC","sourcesContent":["import { IOptions, IOptionsOrLoose } from '../types';\nimport { isPlainObject } from '../util/index';\nimport { fixBooleanProperty, opts } from '../util/fixBooleanProperty';\n\nexport function parseOptionsOrLoose<T extends IOptions>(options: IOptionsOrLoose<T>): T\n{\n\tif (options === false)\n\t{\n\t\toptions = {\n\t\t\tloose: !!options,\n\t\t} as T;\n\t}\n\telse if (!options || typeof options === 'object' && !isPlainObject(options))\n\t{\n\t\toptions = {} as T;\n\t}\n\telse if (typeof options !== 'object' || !isPlainObject(options))\n\t{\n\t\toptions = {\n\t\t\tloose: !!options,\n\t\t} as T;\n\t}\n\telse\n\t{\n\t\toptions = fixBooleanProperty(options, opts)\n\t}\n\n\treturn options\n}\n"]}
|
package/lib/maxSatisfying.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.maxSatisfying =
|
|
3
|
+
exports.maxSatisfying = maxSatisfying;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const max_satisfying_1 = tslib_1.__importDefault(require("semver/ranges/max-satisfying"));
|
|
6
6
|
const handleAmpersandAndSpaces_1 = require("./handleAmpersandAndSpaces");
|
|
7
7
|
function maxSatisfying(versions, range, optionsOrLoose) {
|
|
8
8
|
return (0, max_satisfying_1.default)(versions, (0, handleAmpersandAndSpaces_1.handleAmpersandAndSpaces)(range), optionsOrLoose);
|
|
9
9
|
}
|
|
10
|
-
exports.maxSatisfying = maxSatisfying;
|
|
11
10
|
exports.default = maxSatisfying;
|
|
12
11
|
//# sourceMappingURL=maxSatisfying.js.map
|
package/lib/maxSatisfying.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maxSatisfying.js","sourceRoot":"","sources":["maxSatisfying.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"maxSatisfying.js","sourceRoot":"","sources":["maxSatisfying.ts"],"names":[],"mappings":";;AAKA,sCAMC;;AATD,0FAA+D;AAC/D,yEAAsE;AAEtE,SAAgB,aAAa,CAA4B,QAA0B,EAClF,KAAqB,EACrB,cAAkC;IAGlC,OAAO,IAAA,wBAAmB,EAAC,QAAQ,EAAE,IAAA,mDAAwB,EAAC,KAAK,CAAQ,EAAE,cAAc,CAAC,CAAA;AAC7F,CAAC;AAED,kBAAe,aAAa,CAAA","sourcesContent":["import SemVer from 'semver/classes/semver';\nimport { Options } from 'semver';\nimport semverMaxSatisfying from 'semver/ranges/max-satisfying';\nimport { handleAmpersandAndSpaces } from './handleAmpersandAndSpaces';\n\nexport function maxSatisfying<T extends string | SemVer>(versions: ReadonlyArray<T>,\n\trange: string | Range,\n\toptionsOrLoose?: boolean | Options,\n): T\n{\n\treturn semverMaxSatisfying(versions, handleAmpersandAndSpaces(range) as any, optionsOrLoose)\n}\n\nexport default maxSatisfying\n"]}
|
package/lib/minSatisfying.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.minSatisfying =
|
|
3
|
+
exports.minSatisfying = minSatisfying;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const min_satisfying_1 = tslib_1.__importDefault(require("semver/ranges/min-satisfying"));
|
|
6
6
|
const handleAmpersandAndSpaces_1 = require("./handleAmpersandAndSpaces");
|
|
7
7
|
function minSatisfying(versions, range, optionsOrLoose) {
|
|
8
8
|
return (0, min_satisfying_1.default)(versions, (0, handleAmpersandAndSpaces_1.handleAmpersandAndSpaces)(range), optionsOrLoose);
|
|
9
9
|
}
|
|
10
|
-
exports.minSatisfying = minSatisfying;
|
|
11
10
|
exports.default = minSatisfying;
|
|
12
11
|
//# sourceMappingURL=minSatisfying.js.map
|
package/lib/minSatisfying.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minSatisfying.js","sourceRoot":"","sources":["minSatisfying.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"minSatisfying.js","sourceRoot":"","sources":["minSatisfying.ts"],"names":[],"mappings":";;AAKA,sCAMC;;AATD,0FAA+D;AAC/D,yEAAsE;AAEtE,SAAgB,aAAa,CAA4B,QAA0B,EAClF,KAAqB,EACrB,cAAkC;IAGlC,OAAO,IAAA,wBAAmB,EAAC,QAAQ,EAAE,IAAA,mDAAwB,EAAC,KAAK,CAAQ,EAAE,cAAc,CAAC,CAAA;AAC7F,CAAC;AAED,kBAAe,aAAa,CAAA","sourcesContent":["import SemVer from 'semver/classes/semver';\nimport { Options } from 'semver';\nimport semverMinSatisfying from 'semver/ranges/min-satisfying';\nimport { handleAmpersandAndSpaces } from './handleAmpersandAndSpaces';\n\nexport function minSatisfying<T extends string | SemVer>(versions: ReadonlyArray<T>,\n\trange: string | Range,\n\toptionsOrLoose?: boolean | Options,\n): T\n{\n\treturn semverMinSatisfying(versions, handleAmpersandAndSpaces(range) as any, optionsOrLoose)\n}\n\nexport default minSatisfying\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildRangeSet =
|
|
3
|
+
exports.buildRangeSet = buildRangeSet;
|
|
4
4
|
const split_1 = require("../util/split");
|
|
5
5
|
const array_hyper_unique_1 = require("array-hyper-unique");
|
|
6
6
|
const handleAmpersandAndSpaces_1 = require("../handleAmpersandAndSpaces");
|
|
@@ -16,5 +16,4 @@ function buildRangeSet(range, options = {}) {
|
|
|
16
16
|
rangeSet = (0, array_hyper_unique_1.array_unique_overwrite)(rangeSet);
|
|
17
17
|
return rangeSet;
|
|
18
18
|
}
|
|
19
|
-
exports.buildRangeSet = buildRangeSet;
|
|
20
19
|
//# sourceMappingURL=buildRangeSet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildRangeSet.js","sourceRoot":"","sources":["buildRangeSet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildRangeSet.js","sourceRoot":"","sources":["buildRangeSet.ts"],"names":[],"mappings":";;AAMA,sCAiBC;AAtBD,yCAAmE;AACnE,2DAA4D;AAC5D,0EAAuE;AACvE,+DAA4D;AAE5D,SAAgB,aAAa,CAAC,KAAa,EAAE,UAAoB,EAAE;IAElE,KAAK,GAAG,IAAA,mDAAwB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAEjD,IAAI,QAAQ,GAAG,IAAA,8BAAsB,EAAC,KAAK,CAAC;QAC3C,6CAA6C;SAC5C,GAAG,CAAC,KAAK,CAAC,EAAE;QAEZ,KAAK,GAAG,IAAA,yCAAmB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAE5C,OAAO,IAAA,kBAAU,EAAC,KAAK,CAAC,CAAA;IACzB,CAAC,CAAC,CACF;IAED,QAAQ,GAAG,IAAA,2CAAsB,EAAC,QAAQ,CAAC,CAAA;IAE3C,OAAO,QAAQ,CAAA;AAChB,CAAC","sourcesContent":["import { IOptions } from '../types';\nimport { splitDoubleVerticalBar, splitSpace } from '../util/split';\nimport { array_unique_overwrite } from 'array-hyper-unique';\nimport { handleAmpersandAndSpaces } from '../handleAmpersandAndSpaces';\nimport { normalizeRangeInput } from './normalizeRangeInput';\n\nexport function buildRangeSet(range: string, options: IOptions = {})\n{\n\trange = handleAmpersandAndSpaces(range, options);\n\n\tlet rangeSet = splitDoubleVerticalBar(range)\n\t\t// map the range to a 2d array of comparators\n\t\t.map(range =>\n\t\t{\n\t\t\trange = normalizeRangeInput(range, options);\n\n\t\t\treturn splitSpace(range)\n\t\t})\n\t;\n\n\trangeSet = array_unique_overwrite(rangeSet)\n\n\treturn rangeSet\n}\n"]}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.includeAny = includeAny;
|
|
4
|
+
exports.optimizeComparatorSetAny = optimizeComparatorSetAny;
|
|
5
|
+
exports.filterRemoveNullSet = filterRemoveNullSet;
|
|
6
|
+
exports.fixComparatorSet = fixComparatorSet;
|
|
4
7
|
const detect_1 = require("../comparator/detect");
|
|
5
8
|
function includeAny(comparatorsArray) {
|
|
6
9
|
return comparatorsArray.find(c => (0, detect_1.isAny)(c));
|
|
7
10
|
}
|
|
8
|
-
exports.includeAny = includeAny;
|
|
9
11
|
/**
|
|
10
12
|
* if we have any that are `*`, then the range is just `*`
|
|
11
13
|
*/
|
|
@@ -26,14 +28,12 @@ function optimizeComparatorSetAny(comparatorsSet, unsafeOptimize) {
|
|
|
26
28
|
}
|
|
27
29
|
return comparatorsSet;
|
|
28
30
|
}
|
|
29
|
-
exports.optimizeComparatorSetAny = optimizeComparatorSetAny;
|
|
30
31
|
function filterRemoveNullSet(comparatorsSet, unsafeOptimize) {
|
|
31
32
|
if (unsafeOptimize) {
|
|
32
33
|
return comparatorsSet.filter(ca => !ca.some(detect_1.isNullSet));
|
|
33
34
|
}
|
|
34
35
|
return comparatorsSet.filter(c => !(0, detect_1.isNullSet)(c[0]));
|
|
35
36
|
}
|
|
36
|
-
exports.filterRemoveNullSet = filterRemoveNullSet;
|
|
37
37
|
function fixComparatorSet(comparatorsSet, unsafeOptimize) {
|
|
38
38
|
unsafeOptimize = !!unsafeOptimize;
|
|
39
39
|
// if we have any that are not the null set, throw out null sets.
|
|
@@ -51,5 +51,4 @@ function fixComparatorSet(comparatorsSet, unsafeOptimize) {
|
|
|
51
51
|
comparatorsSet = comparatorsSet.filter(ca => ca.length);
|
|
52
52
|
return comparatorsSet;
|
|
53
53
|
}
|
|
54
|
-
exports.fixComparatorSet = fixComparatorSet;
|
|
55
54
|
//# sourceMappingURL=fixComparatorSet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixComparatorSet.js","sourceRoot":"","sources":["fixComparatorSet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fixComparatorSet.js","sourceRoot":"","sources":["fixComparatorSet.ts"],"names":[],"mappings":";;AAGA,gCAGC;AAKD,4DAyBC;AAED,kDAQC;AAED,4CAwBC;AAvED,iDAAwD;AAExD,SAAgB,UAAU,CAAC,gBAAuC;IAEjE,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,cAAK,EAAC,CAAC,CAAC,CAAC,CAAA;AAC5C,CAAC;AAED;;GAEG;AACH,SAAgB,wBAAwB,CAAC,cAAmC,EAAE,cAAwB;IAErG,cAAc,GAAG,CAAC,CAAC,cAAc,CAAC;IAElC,KAAK,MAAM,EAAE,IAAI,cAAc,EAC/B,CAAC;QACA,IA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G,wBAAwB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;QAC3E,CAAC;IACF,CAAC;IAED,cAAc,GAAG,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IAExD,OAAO,cAAc,CAAA;AACtB,CAAC","sourcesContent":["import { IComparatorArrayInput, IComparatorSetInput } from '../types';\nimport { isAny, isNullSet } from '../comparator/detect';\n\nexport function includeAny(comparatorsArray: IComparatorArrayInput)\n{\n\treturn comparatorsArray.find(c => isAny(c))\n}\n\n/**\n * if we have any that are `*`, then the range is just `*`\n */\nexport function optimizeComparatorSetAny(comparatorsSet: IComparatorSetInput, unsafeOptimize?: boolean)\n{\n\tunsafeOptimize = !!unsafeOptimize;\n\n\tfor (const ca of comparatorsSet)\n\t{\n\t\tif (unsafeOptimize === true)\n\t\t{\n\t\t\tlet cc = includeAny(ca);\n\n\t\t\tif (cc)\n\t\t\t{\n\t\t\t\tcomparatorsSet = [[cc]];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (ca.length === 1 && isAny(ca[0]))\n\t\t{\n\t\t\tcomparatorsSet = [ca];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn comparatorsSet\n}\n\nexport function filterRemoveNullSet(comparatorsSet: IComparatorSetInput, unsafeOptimize?: boolean)\n{\n\tif (unsafeOptimize)\n\t{\n\t\treturn comparatorsSet.filter(ca => !ca.some(isNullSet))\n\t}\n\n\treturn comparatorsSet.filter(c => !isNullSet(c[0]))\n}\n\nexport function fixComparatorSet(comparatorsSet: IComparatorSetInput, unsafeOptimize?: boolean)\n{\n\tunsafeOptimize = !!unsafeOptimize;\n\n\t// if we have any that are not the null set, throw out null sets.\n\tif (comparatorsSet.length > 1)\n\t{\n\t\t// keep the first one, in case they're all null sets\n\t\tconst first = comparatorsSet[0];\n\t\tcomparatorsSet = filterRemoveNullSet(comparatorsSet, unsafeOptimize);\n\n\t\tif (comparatorsSet.length === 0)\n\t\t{\n\t\t\tcomparatorsSet = [first];\n\t\t}\n\t\telse if (comparatorsSet.length > 1)\n\t\t{\n\t\t\tcomparatorsSet = optimizeComparatorSetAny(comparatorsSet, unsafeOptimize);\n\t\t}\n\t}\n\n\tcomparatorsSet = comparatorsSet.filter(ca => ca.length);\n\n\treturn comparatorsSet\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeRangeInput =
|
|
3
|
+
exports.normalizeRangeInput = normalizeRangeInput;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const re_1 = require("semver/internal/re");
|
|
6
6
|
const util_1 = require("./util");
|
|
@@ -22,5 +22,4 @@ function normalizeRangeInput(range, options) {
|
|
|
22
22
|
range = range.replace(const_1.reSpaces, ' ');
|
|
23
23
|
return range;
|
|
24
24
|
}
|
|
25
|
-
exports.normalizeRangeInput = normalizeRangeInput;
|
|
26
25
|
//# sourceMappingURL=normalizeRangeInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeRangeInput.js","sourceRoot":"","sources":["normalizeRangeInput.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"normalizeRangeInput.js","sourceRoot":"","sources":["normalizeRangeInput.ts"],"names":[],"mappings":";;AAMA,kDAoBC;;AAzBD,2CAAsG;AACtG,iCAAuC;AACvC,0EAA0C;AAC1C,oCAAoC;AAEpC,SAAgB,mBAAmB,CAAC,KAAa,EAAE,OAAiB;IAEnE,uCAAuC;IACvC,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAE,CAAC,MAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,OAAE,CAAC,MAAC,CAAC,WAAW,CAAC,CAAA;IACrE,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,IAAA,oBAAa,EAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAA;IACnE,IAAA,eAAK,EAAC,gBAAgB,EAAE,KAAK,CAAC,CAAA;IAC9B,uCAAuC;IACvC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAE,CAAC,MAAC,CAAC,cAAc,CAAC,EAAE,0BAAqB,CAAC,CAAA;IAClE,IAAA,eAAK,EAAC,iBAAiB,EAAE,KAAK,EAAE,OAAE,CAAC,MAAC,CAAC,cAAc,CAAC,CAAC,CAAA;IAErD,wBAAwB;IACxB,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAE,CAAC,MAAC,CAAC,SAAS,CAAC,EAAE,qBAAgB,CAAC,CAAA;IAExD,wBAAwB;IACxB,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAE,CAAC,MAAC,CAAC,SAAS,CAAC,EAAE,qBAAgB,CAAC,CAAA;IAExD,mBAAmB;IACnB,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,gBAAQ,EAAE,GAAG,CAAC,CAAA;IAEpC,OAAO,KAAK,CAAA;AACb,CAAC","sourcesContent":["import { IOptions } from '../types';\nimport { caretTrimReplace, comparatorTrimReplace, re, t, tildeTrimReplace } from 'semver/internal/re';\nimport { hyphenReplace } from './util';\nimport debug from 'semver/internal/debug';\nimport { reSpaces } from '../const';\n\nexport function normalizeRangeInput(range: string, options: IOptions)\n{\n\t// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n\tconst hr = options.loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n\trange = range.replace(hr, hyphenReplace(options.includePrerelease))\n\tdebug('hyphen replace', range)\n\t// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n\trange = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n\tdebug('comparator trim', range, re[t.COMPARATORTRIM])\n\n\t// `~ 1.2.3` => `~1.2.3`\n\trange = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n\n\t// `^ 1.2.3` => `^1.2.3`\n\trange = range.replace(re[t.CARETTRIM], caretTrimReplace)\n\n\t// normalize spaces\n\trange = range.replace(reSpaces, ' ')\n\n\treturn range\n}\n"]}
|
package/lib/range/options.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports._isSameOptions = _isSameOptions;
|
|
4
|
+
exports._copyOptions = _copyOptions;
|
|
5
|
+
exports._normalizeOptions = _normalizeOptions;
|
|
4
6
|
const fixBooleanProperty_1 = require("../util/fixBooleanProperty");
|
|
5
7
|
function _isSameOptions(oldOptions, newOptions) {
|
|
6
8
|
return oldOptions.loose === newOptions.loose &&
|
|
7
9
|
oldOptions.includePrerelease === newOptions.includePrerelease;
|
|
8
10
|
}
|
|
9
|
-
exports._isSameOptions = _isSameOptions;
|
|
10
11
|
function _copyOptions(oldOptions, newOptions) {
|
|
11
12
|
oldOptions.loose = !!newOptions.loose;
|
|
12
13
|
oldOptions.includePrerelease = !!newOptions.includePrerelease;
|
|
13
14
|
return oldOptions;
|
|
14
15
|
}
|
|
15
|
-
exports._copyOptions = _copyOptions;
|
|
16
16
|
function _normalizeOptions(options) {
|
|
17
17
|
options = (0, fixBooleanProperty_1.fixBooleanProperty)(options, [
|
|
18
18
|
'loose',
|
|
@@ -20,5 +20,4 @@ function _normalizeOptions(options) {
|
|
|
20
20
|
], true);
|
|
21
21
|
return options;
|
|
22
22
|
}
|
|
23
|
-
exports._normalizeOptions = _normalizeOptions;
|
|
24
23
|
//# sourceMappingURL=options.js.map
|
package/lib/range/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["options.ts"],"names":[],"mappings":";;AAIA,wCAIC;AAED,oCAMC;AAED,8CAQC;AAxBD,mEAAsE;AAEtE,SAAgB,cAAc,CAAC,UAAoB,EAAE,UAAoB;IAExE,OAAO,UAAU,CAAC,KAAK,KAAK,UAAU,CAAC,KAAK;QAC3C,UAAU,CAAC,iBAAiB,KAAK,UAAU,CAAC,iBAAiB,CAAA;AAC/D,CAAC;AAED,SAAgB,YAAY,CAAC,UAAoB,EAAE,UAAoB;IAEtE,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC,UAAU,CAAC,KAAK,CAAA;IACrC,UAAU,CAAC,iBAAiB,GAAG,CAAC,CAAC,UAAU,CAAC,iBAAiB,CAAA;IAE7D,OAAO,UAAU,CAAA;AAClB,CAAC;AAED,SAAgB,iBAAiB,CAAC,OAAiB;IAElD,OAAO,GAAG,IAAA,uCAAkB,EAAC,OAAO,EAAE;QACrC,OAAO;QACP,mBAAmB;KACnB,EAAE,IAAI,CAAC,CAAA;IAER,OAAO,OAAO,CAAA;AACf,CAAC","sourcesContent":["import semverRange from 'semver/classes/range';\nimport { IOptions } from '../types';\nimport { fixBooleanProperty, opts } from '../util/fixBooleanProperty';\n\nexport function _isSameOptions(oldOptions: IOptions, newOptions: IOptions)\n{\n\treturn oldOptions.loose === newOptions.loose &&\n\t\toldOptions.includePrerelease === newOptions.includePrerelease\n}\n\nexport function _copyOptions(oldOptions: IOptions, newOptions: IOptions)\n{\n\toldOptions.loose = !!newOptions.loose\n\toldOptions.includePrerelease = !!newOptions.includePrerelease\n\n\treturn oldOptions\n}\n\nexport function _normalizeOptions(options: IOptions)\n{\n\toptions = fixBooleanProperty(options, [\n\t\t'loose',\n\t\t'includePrerelease',\n\t], true)\n\n\treturn options\n}\n"]}
|
package/lib/range/parseRange.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getMemoOpts = getMemoOpts;
|
|
4
|
+
exports.normalizeRangeInputForComparator = normalizeRangeInputForComparator;
|
|
5
|
+
exports.parseRangeCore = parseRangeCore;
|
|
6
|
+
exports.filterRangeListForComparator = filterRangeListForComparator;
|
|
7
|
+
exports.reduceComparatorList = reduceComparatorList;
|
|
8
|
+
exports.parseRange = parseRange;
|
|
4
9
|
const cache_1 = require("./cache");
|
|
5
10
|
const semver_1 = require("semver");
|
|
6
11
|
const detect_1 = require("../comparator/detect");
|
|
@@ -16,7 +21,6 @@ const normalizeRangeInput_1 = require("./normalizeRangeInput");
|
|
|
16
21
|
function getMemoOpts(options) {
|
|
17
22
|
return Object.keys(options).filter(k => options[k]).join(',');
|
|
18
23
|
}
|
|
19
|
-
exports.getMemoOpts = getMemoOpts;
|
|
20
24
|
function normalizeRangeInputForComparator(range, options) {
|
|
21
25
|
let rangeList = (0, split_1.splitSpace)(range)
|
|
22
26
|
.map(comp => (0, util_1.parseComparator)(comp, options));
|
|
@@ -25,7 +29,6 @@ function normalizeRangeInputForComparator(range, options) {
|
|
|
25
29
|
.map(comp => (0, util_1.replaceGTE0)(comp, options));
|
|
26
30
|
return (0, array_hyper_unique_1.array_unique_overwrite)(rangeList);
|
|
27
31
|
}
|
|
28
|
-
exports.normalizeRangeInputForComparator = normalizeRangeInputForComparator;
|
|
29
32
|
function parseRangeCore(range, options) {
|
|
30
33
|
range = (0, normalizeRangeInput_1.normalizeRangeInput)(range, options);
|
|
31
34
|
// At this point, the range is completely trimmed and
|
|
@@ -39,7 +42,6 @@ function parseRangeCore(range, options) {
|
|
|
39
42
|
const result = reduceComparatorList(compList);
|
|
40
43
|
return result;
|
|
41
44
|
}
|
|
42
|
-
exports.parseRangeCore = parseRangeCore;
|
|
43
45
|
/**
|
|
44
46
|
* in loose mode, throw out any that are not valid comparators
|
|
45
47
|
*/
|
|
@@ -47,7 +49,6 @@ function filterRangeListForComparator(rangeList, options) {
|
|
|
47
49
|
const compRe = options.loose ? re_1.re[re_1.t.COMPARATORLOOSE] : re_1.re[re_1.t.COMPARATOR];
|
|
48
50
|
return rangeList.filter(comp => !!comp.match(compRe));
|
|
49
51
|
}
|
|
50
|
-
exports.filterRangeListForComparator = filterRangeListForComparator;
|
|
51
52
|
/**
|
|
52
53
|
* if any comparators are the null set, then replace with JUST null set
|
|
53
54
|
* if more than one comparator, remove any * comparators
|
|
@@ -68,7 +69,6 @@ function reduceComparatorList(compList) {
|
|
|
68
69
|
const result = [...rangeMap.values()];
|
|
69
70
|
return result;
|
|
70
71
|
}
|
|
71
|
-
exports.reduceComparatorList = reduceComparatorList;
|
|
72
72
|
function parseRange(range, options) {
|
|
73
73
|
range = range.trim();
|
|
74
74
|
// memoize range parsing for performance.
|
|
@@ -83,5 +83,4 @@ function parseRange(range, options) {
|
|
|
83
83
|
cache_1.cache.set(memoKey, result);
|
|
84
84
|
return result;
|
|
85
85
|
}
|
|
86
|
-
exports.parseRange = parseRange;
|
|
87
86
|
//# sourceMappingURL=parseRange.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseRange.js","sourceRoot":"","sources":["parseRange.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parseRange.js","sourceRoot":"","sources":["parseRange.ts"],"names":[],"mappings":";;AAcA,kCAGC;AAED,4EAWC;AAED,wCAoBC;AAKD,oEAKC;AAOD,oDAoBC;AAED,gCAkBC;AA7GD,mCAAgC;AAChC,mCAAoC;AACpC,iDAAiD;AAEjD,2CAA0C;AAC1C,iCAAsD;AACtD,yCAA2C;AAC3C,2DAA4D;AAC5D,+DAA4D;AAE5D;;;GAGG;AACH,SAAgB,WAAW,CAAC,OAAiB;IAE5C,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC9D,CAAC;AAED,SAAgB,gCAAgC,CAAC,KAAa,EAAE,OAAiB;IAEhF,IAAI,SAAS,GAAG,IAAA,kBAAU,EAAC,KAAK,CAA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\nimport { Comparator } from 'semver';\nimport { isNullSet } from '../comparator/detect';\nimport { IOptions } from '../types';\nimport { re, t } from 'semver/internal/re'\nimport { parseComparator, replaceGTE0 } from './util';\nimport { splitSpace } from '../util/split';\nimport { array_unique_overwrite } from 'array-hyper-unique';\nimport { normalizeRangeInput } from './normalizeRangeInput';\n\n/**\n * memoize range parsing for performance.\n * this is a very hot path, and fully deterministic.\n */\nexport function getMemoOpts(options: IOptions)\n{\n\treturn Object.keys(options).filter(k => options[k]).join(',')\n}\n\nexport function normalizeRangeInputForComparator(range: string, options: IOptions)\n{\n\tlet rangeList = splitSpace(range)\n\t\t.map(comp => parseComparator(comp, options))\n\t;\n\n\trangeList = splitSpace(rangeList.join(' '))\n\t\t// >=0.0.0 is equivalent to *\n\t\t.map(comp => replaceGTE0(comp, options))\n\n\treturn array_unique_overwrite(rangeList)\n}\n\nexport function parseRangeCore(range: string, options: IOptions): ReadonlyArray<Comparator>\n{\n\trange = normalizeRangeInput(range, options);\n\n\t// At this point, the range is completely trimmed and\n\t// ready to be split into comparators.\n\n\tlet rangeList = normalizeRangeInputForComparator(range, options)\n\n\tif (options.loose)\n\t{\n\t\trangeList = filterRangeListForComparator(rangeList, options)\n\t}\n\n\tlet compList = rangeList\n\t\t.map(comp => new Comparator(comp, options))\n\n\tconst result = reduceComparatorList(compList)\n\n\treturn result\n}\n\n/**\n * in loose mode, throw out any that are not valid comparators\n */\nexport function filterRangeListForComparator(rangeList: string[], options: IOptions)\n{\n\tconst compRe = options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n\n\treturn rangeList.filter(comp => !!comp.match(compRe))\n}\n\n/**\n * if any comparators are the null set, then replace with JUST null set\n * if more than one comparator, remove any * comparators\n * also, don't include the same comparator more than once\n */\nexport function reduceComparatorList(compList: Comparator[])\n{\n\tconst l = compList.length\n\tconst rangeMap = new Map<string, Comparator>()\n\tfor (const comp of compList)\n\t{\n\t\tif (isNullSet(comp))\n\t\t{\n\t\t\treturn [comp]\n\t\t}\n\t\trangeMap.set(comp.value, comp)\n\t}\n\tif (rangeMap.size > 1 && rangeMap.has(''))\n\t{\n\t\trangeMap.delete('')\n\t}\n\n\tconst result = [...rangeMap.values()]\n\n\treturn result\n}\n\nexport function parseRange(range: string, options: IOptions): ReadonlyArray<Comparator>\n{\n\trange = range.trim()\n\n\t// memoize range parsing for performance.\n\t// this is a very hot path, and fully deterministic.\n\tconst memoOpts = getMemoOpts(options)\n\tconst memoKey = `parseRange:${memoOpts}:${range}`\n\tconst cached = cache.get(memoKey)\n\tif (cached)\n\t{\n\t\treturn cached\n\t}\n\n\tconst result = parseRangeCore(range, options)\n\n\tcache.set(memoKey, result)\n\treturn result\n}\n"]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stringifyRangeSet =
|
|
3
|
+
exports.stringifyRangeSet = stringifyRangeSet;
|
|
4
4
|
const const_1 = require("../const");
|
|
5
5
|
function stringifyRangeSet(rangeSet) {
|
|
6
6
|
return rangeSet
|
|
7
7
|
.map(a => a.join(' '))
|
|
8
8
|
.join(const_1.separatorDoubleVerticalBar);
|
|
9
9
|
}
|
|
10
|
-
exports.stringifyRangeSet = stringifyRangeSet;
|
|
11
10
|
//# sourceMappingURL=stringifyRangeSet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringifyRangeSet.js","sourceRoot":"","sources":["stringifyRangeSet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stringifyRangeSet.js","sourceRoot":"","sources":["stringifyRangeSet.ts"],"names":[],"mappings":";;AAGA,8CAKC;AAPD,oCAAsD;AAEtD,SAAgB,iBAAiB,CAAC,QAA0C;IAE3E,OAAO,QAAQ;SACb,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACrB,IAAI,CAAC,kCAA0B,CAAC,CAAA;AACnC,CAAC","sourcesContent":["import { buildRangeSet } from './buildRangeSet';\nimport { separatorDoubleVerticalBar } from '../const';\n\nexport function stringifyRangeSet(rangeSet: ReturnType<typeof buildRangeSet>)\n{\n\treturn rangeSet\n\t\t.map(a => a.join(' '))\n\t\t.join(separatorDoubleVerticalBar)\n}\n"]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toRangeString =
|
|
3
|
+
exports.toRangeString = toRangeString;
|
|
4
4
|
function toRangeString(range) {
|
|
5
5
|
return range || '*';
|
|
6
6
|
}
|
|
7
|
-
exports.toRangeString = toRangeString;
|
|
8
7
|
//# sourceMappingURL=toRangeString.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toRangeString.js","sourceRoot":"","sources":["toRangeString.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toRangeString.js","sourceRoot":"","sources":["toRangeString.ts"],"names":[],"mappings":";;AACA,sCAGC;AAHD,SAAgB,aAAa,CAAC,KAAa;IAE1C,OAAO,KAAK,IAAI,GAAG,CAAA;AACpB,CAAC","sourcesContent":["\nexport function toRangeString(range: string): string | '*'\n{\n\treturn range || '*'\n}\n"]}
|
package/lib/range/util.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.hyphenReplace = hyphenReplace;
|
|
4
|
+
exports.isX = isX;
|
|
5
|
+
exports.replaceGTE0 = replaceGTE0;
|
|
6
|
+
exports.parseComparator = parseComparator;
|
|
7
|
+
exports.replaceTildes = replaceTildes;
|
|
8
|
+
exports.replaceTilde = replaceTilde;
|
|
9
|
+
exports.replaceCarets = replaceCarets;
|
|
10
|
+
exports.replaceCaret = replaceCaret;
|
|
11
|
+
exports.replaceXRanges = replaceXRanges;
|
|
12
|
+
exports.replaceXRange = replaceXRange;
|
|
13
|
+
exports.replaceStars = replaceStars;
|
|
4
14
|
const re_1 = require("semver/internal/re");
|
|
5
15
|
/**
|
|
6
16
|
* This function is passed to string.replace(re[t.HYPHENRANGE])
|
|
@@ -47,16 +57,13 @@ function hyphenReplace(incPr) {
|
|
|
47
57
|
return (`${from} ${to}`).trim();
|
|
48
58
|
};
|
|
49
59
|
}
|
|
50
|
-
exports.hyphenReplace = hyphenReplace;
|
|
51
60
|
function isX(id) {
|
|
52
61
|
return !id || id.toLowerCase() === 'x' || id === '*';
|
|
53
62
|
}
|
|
54
|
-
exports.isX = isX;
|
|
55
63
|
function replaceGTE0(comp, options) {
|
|
56
64
|
return comp.trim()
|
|
57
65
|
.replace(re_1.re[(options === null || options === void 0 ? void 0 : options.includePrerelease) ? re_1.t.GTE0PRE : re_1.t.GTE0], '');
|
|
58
66
|
}
|
|
59
|
-
exports.replaceGTE0 = replaceGTE0;
|
|
60
67
|
/**
|
|
61
68
|
* comprised of xranges, tildes, stars, and gtlt's at this point.
|
|
62
69
|
* already replaced the hyphen ranges
|
|
@@ -69,7 +76,6 @@ function parseComparator(comp, options) {
|
|
|
69
76
|
comp = replaceStars(comp, options);
|
|
70
77
|
return comp;
|
|
71
78
|
}
|
|
72
|
-
exports.parseComparator = parseComparator;
|
|
73
79
|
/**
|
|
74
80
|
* ~, ~> --> * (any, kinda silly)
|
|
75
81
|
* ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
|
|
@@ -81,7 +87,6 @@ function replaceTildes(comp, options) {
|
|
|
81
87
|
return replaceTilde(comp, options);
|
|
82
88
|
}).join(' ');
|
|
83
89
|
}
|
|
84
|
-
exports.replaceTildes = replaceTildes;
|
|
85
90
|
function replaceTilde(comp, options) {
|
|
86
91
|
const r = options.loose ? re_1.re[re_1.t.TILDELOOSE] : re_1.re[re_1.t.TILDE];
|
|
87
92
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
@@ -106,7 +111,6 @@ function replaceTilde(comp, options) {
|
|
|
106
111
|
return ret;
|
|
107
112
|
});
|
|
108
113
|
}
|
|
109
|
-
exports.replaceTilde = replaceTilde;
|
|
110
114
|
/**
|
|
111
115
|
* ^ --> * (any, kinda silly)
|
|
112
116
|
* ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
|
|
@@ -120,7 +124,6 @@ function replaceCarets(comp, options) {
|
|
|
120
124
|
return replaceCaret(comp, options);
|
|
121
125
|
}).join(' ');
|
|
122
126
|
}
|
|
123
|
-
exports.replaceCarets = replaceCarets;
|
|
124
127
|
function replaceCaret(comp, options) {
|
|
125
128
|
const r = options.loose ? re_1.re[re_1.t.CARETLOOSE] : re_1.re[re_1.t.CARET];
|
|
126
129
|
const z = options.includePrerelease ? '-0' : '';
|
|
@@ -169,13 +172,11 @@ function replaceCaret(comp, options) {
|
|
|
169
172
|
return ret;
|
|
170
173
|
});
|
|
171
174
|
}
|
|
172
|
-
exports.replaceCaret = replaceCaret;
|
|
173
175
|
function replaceXRanges(comp, options) {
|
|
174
176
|
return comp.split(/\s+/).map((comp) => {
|
|
175
177
|
return replaceXRange(comp, options);
|
|
176
178
|
}).join(' ');
|
|
177
179
|
}
|
|
178
|
-
exports.replaceXRanges = replaceXRanges;
|
|
179
180
|
function replaceXRange(comp, options) {
|
|
180
181
|
comp = comp.trim();
|
|
181
182
|
const r = options.loose ? re_1.re[re_1.t.XRANGELOOSE] : re_1.re[re_1.t.XRANGE];
|
|
@@ -246,7 +247,6 @@ function replaceXRange(comp, options) {
|
|
|
246
247
|
return ret;
|
|
247
248
|
});
|
|
248
249
|
}
|
|
249
|
-
exports.replaceXRange = replaceXRange;
|
|
250
250
|
/**
|
|
251
251
|
* and '' means "any version", just remove the *s entirely.
|
|
252
252
|
*/
|
|
@@ -254,5 +254,4 @@ function replaceStars(comp, options) {
|
|
|
254
254
|
// Looseness is ignored here. star is always as loose as it gets!
|
|
255
255
|
return comp.trim().replace(re_1.re[re_1.t.STAR], '');
|
|
256
256
|
}
|
|
257
|
-
exports.replaceStars = replaceStars;
|
|
258
257
|
//# sourceMappingURL=util.js.map
|
package/lib/range/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAI3C;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,KAAc;IAE3C,OAAO,CAAC,EAAU,EACjB,IAAY,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,GAAW,EAAE,EAAU,EACzE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,GAAW,EAAE,EAAU,EACtE,EAAE;QAEH,IAAI,GAAG,CAAC,EAAE,CAAC,EACX,CAAC;YACA,IAAI,GAAG,EAAE,CAAA;QACV,CAAC;aACI,IAAI,GAAG,CAAC,EAAE,CAAC,EAChB,CAAC;YACA,IAAI,GAAG,KAAK,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;QACzC,CAAC;aACI,IAAI,GAAG,CAAC,EAAE,CAAC,EAChB,CAAC;YACA,IAAI,GAAG,KAAK,EAAE,IAAI,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;QAC7C,CAAC;aACI,IAAI,GAAG,EACZ,CAAC;YACA,IAAI,GAAG,KAAK,IAAI,EAAE,CAAA;QACnB,CAAC;aAED,CAAC;YACA,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;QACvC,CAAC;QAED,IAAI,GAAG,CAAC,EAAE,CAAC,EACX,CAAC;YACA,EAAE,GAAG,EAAE,CAAA;QACR,CAAC;aACI,IAAI,GAAG,CAAC,EAAE,CAAC,EAChB,CAAC;YACA,EAAE,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,CAAC,CAAA;gBACX,CAAC;YACF,CAAC;YAED,IAAI,IAAI,KAAK,GAAG,EAChB,CAAC;gBACA,EAAE,GAAG,IAAI,CAAA;YACV,CAAC;YAED,GAAG,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,CAAA;QACnC,CAAC;aACI,IAAI,EAAE,EACX,CAAC;YACA,GAAG,GAAG,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAA;QACzC,CAAC;aACI,IAAI,EAAE,EACX,CAAC;YACA,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EACtB,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAA;QACvB,CAAC;QAED,OAAO,GAAG,CAAA;IACX,CAAC,CAAC,CAAA;AACH,CAAC;AA/FD,sCA+FC;AAED;;GAEG;AACH,SAAgB,YAAY,CAAC,IAAY,EAAE,OAAiB;IAE3D,kEAAkE;IAClE,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,OAAE,CAAC,MAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3C,CAAC;AAJD,oCAIC","sourcesContent":["import { re, t } from 'semver/internal/re';\nimport { IOptions } from '../types';\nimport { EnumSemverVersion } from '../const';\n\n/**\n * This function is passed to string.replace(re[t.HYPHENRANGE])\n * M, m, patch, prerelease, build\n * 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n * 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n * 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n */\nexport function hyphenReplace(incPr: boolean)\n{\n\treturn ($0: string,\n\t\tfrom: string, fM: string, fm: string, fp: string, fpr: string, fb: string,\n\t\tto: string, tM: string, tm: string, tp: string, tpr: string, tb: string,\n\t) =>\n\t{\n\t\tif (isX(fM))\n\t\t{\n\t\t\tfrom = ''\n\t\t}\n\t\telse if (isX(fm))\n\t\t{\n\t\t\tfrom = `>=${fM}.0.0${incPr ? '-0' : ''}`\n\t\t}\n\t\telse if (isX(fp))\n\t\t{\n\t\t\tfrom = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n\t\t}\n\t\telse if (fpr)\n\t\t{\n\t\t\tfrom = `>=${from}`\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfrom = `>=${from}${incPr ? '-0' : ''}`\n\t\t}\n\n\t\tif (isX(tM))\n\t\t{\n\t\t\tto = ''\n\t\t}\n\t\telse if (isX(tm))\n\t\t{\n\t\t\tto = `<${+tM + 1}.0.0-0`\n\t\t}\n\t\telse if (isX(tp))\n\t\t{\n\t\t\tto = `<${tM}.${+tm + 1}.0-0`\n\t\t}\n\t\telse if (tpr)\n\t\t{\n\t\t\tto = `<=${tM}.${tm}.${tp}-${tpr}`\n\t\t}\n\t\telse if (incPr)\n\t\t{\n\t\t\tto = `<${tM}.${tm}.${+tp + 1}-0`\n\t\t}\n\t\telse\n\t\t{\n\t\t\tto = `<=${to}`\n\t\t}\n\n\t\treturn (`${from} ${to}`).trim()\n\t};\n}\n\nexport function isX(id: string): id is '' | '0' | '*' | 'x'\n{\n\treturn !id || id.toLowerCase() === 'x' || id === '*';\n}\n\nexport function replaceGTE0(comp: string, options: IOptions)\n{\n\treturn comp.trim()\n\t\t.replace(re[options?.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n/**\n * comprised of xranges, tildes, stars, and gtlt's at this point.\n * already replaced the hyphen ranges\n * turn into a set of JUST comparators.\n */\nexport function parseComparator(comp: string, options: IOptions)\n{\n\tcomp = replaceCarets(comp, options)\n\tcomp = replaceTildes(comp, options)\n\tcomp = replaceXRanges(comp, options)\n\tcomp = replaceStars(comp, options)\n\treturn comp\n}\n\n/**\n * ~, ~> --> * (any, kinda silly)\n * ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n * ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n * ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n */\nexport function replaceTildes(comp: string, options: IOptions)\n{\n\treturn comp.trim().split(/\\s+/).map((comp) =>\n\t{\n\t\treturn replaceTilde(comp, options)\n\t}).join(' ');\n}\n\nexport function replaceTilde(comp: string, options: IOptions)\n{\n\tconst r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n\treturn comp.replace(r, (_, M, m, p, pr) =>\n\t{\n\n\t\tlet ret: string\n\n\t\tif (isX(M))\n\t\t{\n\t\t\tret = ''\n\t\t}\n\t\telse if (isX(m))\n\t\t{\n\t\t\tret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n\t\t}\n\t\telse if (isX(p))\n\t\t{\n\t\t\t// ~1.2 == >=1.2.0 <1.3.0-0\n\t\t\tret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n\t\t}\n\t\telse if (pr)\n\t\t{\n\n\t\t\tret = `>=${M}.${m}.${p}-${pr\n\t\t\t} <${M}.${+m + 1}.0-0`\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// ~1.2.3 == >=1.2.3 <1.3.0-0\n\t\t\tret = `>=${M}.${m}.${p\n\t\t\t} <${M}.${+m + 1}.0-0`\n\t\t}\n\n\t\treturn ret\n\t})\n}\n\n/**\n * ^ --> * (any, kinda silly)\n * ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n * ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n * ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n * ^1.2.3 --> >=1.2.3 <2.0.0-0\n * ^1.2.0 --> >=1.2.0 <2.0.0-0\n */\nexport function replaceCarets(comp: string, options: IOptions)\n{\n\treturn comp.trim().split(/\\s+/).map((comp) =>\n\t{\n\t\treturn replaceCaret(comp, options)\n\t}).join(' ');\n}\n\nexport function replaceCaret(comp: string, options: IOptions)\n{\n\n\tconst r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n\tconst z = options.includePrerelease ? '-0' : ''\n\treturn comp.replace(r, (_, M, m, p, pr) =>\n\t{\n\n\t\tlet ret: string\n\n\t\tif (isX(M))\n\t\t{\n\t\t\tret = ''\n\t\t}\n\t\telse if (isX(m))\n\t\t{\n\t\t\tret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n\t\t}\n\t\telse if (isX(p))\n\t\t{\n\t\t\tif (M === '0')\n\t\t\t{\n\t\t\t\tret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n\t\t\t}\n\t\t}\n\t\telse if (pr)\n\t\t{\n\n\t\t\tif (M === '0')\n\t\t\t{\n\t\t\t\tif (m === '0')\n\t\t\t\t{\n\t\t\t\t\tret = `>=${M}.${m}.${p}-${pr\n\t\t\t\t\t} <${M}.${m}.${+p + 1}-0`\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tret = `>=${M}.${m}.${p}-${pr\n\t\t\t\t\t} <${M}.${+m + 1}.0-0`\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tret = `>=${M}.${m}.${p}-${pr\n\t\t\t\t} <${+M + 1}.0.0-0`\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\tif (M === '0')\n\t\t\t{\n\t\t\t\tif (m === '0')\n\t\t\t\t{\n\t\t\t\t\tret = `>=${M}.${m}.${p\n\t\t\t\t\t}${z} <${M}.${m}.${+p + 1}-0`\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tret = `>=${M}.${m}.${p\n\t\t\t\t\t}${z} <${M}.${+m + 1}.0-0`\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tret = `>=${M}.${m}.${p\n\t\t\t\t} <${+M + 1}.0.0-0`\n\t\t\t}\n\t\t}\n\n\t\treturn ret\n\t})\n}\n\nexport function replaceXRanges(comp: string, options: IOptions)\n{\n\n\treturn comp.split(/\\s+/).map((comp) =>\n\t{\n\t\treturn replaceXRange(comp, options)\n\t}).join(' ')\n}\n\nexport function replaceXRange(comp: string, options: IOptions)\n{\n\tcomp = comp.trim()\n\tconst r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n\treturn comp.replace(r, (ret, gtlt, M, m, p, pr) =>\n\t{\n\n\t\tconst xM = isX(M)\n\t\tconst xm = xM || isX(m)\n\t\tconst xp = xm || isX(p)\n\t\tconst anyX = xp\n\n\t\tif (gtlt === '=' && anyX)\n\t\t{\n\t\t\tgtlt = ''\n\t\t}\n\n\t\t// if we're including prereleases in the match, then we need\n\t\t// to fix this to -0, the lowest possible prerelease value\n\t\tpr = options.includePrerelease ? '-0' : ''\n\n\t\tif (xM)\n\t\t{\n\t\t\tif (gtlt === '>' || gtlt === '<')\n\t\t\t{\n\t\t\t\t// nothing is allowed\n\t\t\t\tret = EnumSemverVersion.NULL\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// nothing is forbidden\n\t\t\t\tret = EnumSemverVersion.STAR\n\t\t\t}\n\t\t}\n\t\telse if (gtlt && anyX)\n\t\t{\n\t\t\t// we know patch is an x, because we have any x at all.\n\t\t\t// replace X with 0\n\t\t\tif (xm)\n\t\t\t{\n\t\t\t\tm = 0\n\t\t\t}\n\t\t\tp = 0\n\n\t\t\tif (gtlt === '>')\n\t\t\t{\n\t\t\t\t// >1 => >=2.0.0\n\t\t\t\t// >1.2 => >=1.3.0\n\t\t\t\tgtlt = '>='\n\t\t\t\tif (xm)\n\t\t\t\t{\n\t\t\t\t\tM = +M + 1\n\t\t\t\t\tm = 0\n\t\t\t\t\tp = 0\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tm = +m + 1\n\t\t\t\t\tp = 0\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (gtlt === '<=')\n\t\t\t{\n\t\t\t\t// <=0.7.x is actually <0.8.0, since any 0.7.x should\n\t\t\t\t// pass. Similarly, <=7.x is actually <8.0.0, etc.\n\t\t\t\tgtlt = '<'\n\t\t\t\tif (xm)\n\t\t\t\t{\n\t\t\t\t\tM = +M + 1\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tm = +m + 1\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (gtlt === '<')\n\t\t\t{\n\t\t\t\tpr = '-0'\n\t\t\t}\n\n\t\t\tret = `${gtlt + M}.${m}.${p}${pr}`\n\t\t}\n\t\telse if (xm)\n\t\t{\n\t\t\tret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n\t\t}\n\t\telse if (xp)\n\t\t{\n\t\t\tret = `>=${M}.${m}.0${pr\n\t\t\t} <${M}.${+m + 1}.0-0`\n\t\t}\n\n\t\treturn ret\n\t})\n}\n\n/**\n * and '' means \"any version\", just remove the *s entirely.\n */\nexport function replaceStars(comp: string, options: IOptions)\n{\n\t// Looseness is ignored here. star is always as loose as it gets!\n\treturn comp.trim().replace(re[t.STAR], '')\n}\n"]}
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":";;AAWA,sCAuDC;AAED,kBAGC;AAED,kCAIC;AAOD,0CAOC;AAQD,sCAMC;AAED,oCAoCC;AAUD,sCAMC;AAED,oCA4EC;AAED,wCAOC;AAED,sCA+FC;AAKD,oCAIC;AAhWD,2CAA2C;AAI3C;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,KAAc;IAE3C,OAAO,CAAC,EAAU,EACjB,IAAY,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,GAAW,EAAE,EAAU,EACzE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,GAAW,EAAE,EAAU,EACtE,EAAE;QAEH,IAAI,GAAG,CAAC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kEAAkE;IAClE,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,OAAE,CAAC,MAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3C,CAAC","sourcesContent":["import { re, t } from 'semver/internal/re';\nimport { IOptions } from '../types';\nimport { EnumSemverVersion } from '../const';\n\n/**\n * This function is passed to string.replace(re[t.HYPHENRANGE])\n * M, m, patch, prerelease, build\n * 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n * 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n * 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n */\nexport function hyphenReplace(incPr: boolean)\n{\n\treturn ($0: string,\n\t\tfrom: string, fM: string, fm: string, fp: string, fpr: string, fb: string,\n\t\tto: string, tM: string, tm: string, tp: string, tpr: string, tb: string,\n\t) =>\n\t{\n\t\tif (isX(fM))\n\t\t{\n\t\t\tfrom = ''\n\t\t}\n\t\telse if (isX(fm))\n\t\t{\n\t\t\tfrom = `>=${fM}.0.0${incPr ? '-0' : ''}`\n\t\t}\n\t\telse if (isX(fp))\n\t\t{\n\t\t\tfrom = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n\t\t}\n\t\telse if (fpr)\n\t\t{\n\t\t\tfrom = `>=${from}`\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfrom = `>=${from}${incPr ? '-0' : ''}`\n\t\t}\n\n\t\tif (isX(tM))\n\t\t{\n\t\t\tto = ''\n\t\t}\n\t\telse if (isX(tm))\n\t\t{\n\t\t\tto = `<${+tM + 1}.0.0-0`\n\t\t}\n\t\telse if (isX(tp))\n\t\t{\n\t\t\tto = `<${tM}.${+tm + 1}.0-0`\n\t\t}\n\t\telse if (tpr)\n\t\t{\n\t\t\tto = `<=${tM}.${tm}.${tp}-${tpr}`\n\t\t}\n\t\telse if (incPr)\n\t\t{\n\t\t\tto = `<${tM}.${tm}.${+tp + 1}-0`\n\t\t}\n\t\telse\n\t\t{\n\t\t\tto = `<=${to}`\n\t\t}\n\n\t\treturn (`${from} ${to}`).trim()\n\t};\n}\n\nexport function isX(id: string): id is '' | '0' | '*' | 'x'\n{\n\treturn !id || id.toLowerCase() === 'x' || id === '*';\n}\n\nexport function replaceGTE0(comp: string, options: IOptions)\n{\n\treturn comp.trim()\n\t\t.replace(re[options?.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n/**\n * comprised of xranges, tildes, stars, and gtlt's at this point.\n * already replaced the hyphen ranges\n * turn into a set of JUST comparators.\n */\nexport function parseComparator(comp: string, options: IOptions)\n{\n\tcomp = replaceCarets(comp, options)\n\tcomp = replaceTildes(comp, options)\n\tcomp = replaceXRanges(comp, options)\n\tcomp = replaceStars(comp, options)\n\treturn comp\n}\n\n/**\n * ~, ~> --> * (any, kinda silly)\n * ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n * ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n * ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n */\nexport function replaceTildes(comp: string, options: IOptions)\n{\n\treturn comp.trim().split(/\\s+/).map((comp) =>\n\t{\n\t\treturn replaceTilde(comp, options)\n\t}).join(' ');\n}\n\nexport function replaceTilde(comp: string, options: IOptions)\n{\n\tconst r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n\treturn comp.replace(r, (_, M, m, p, pr) =>\n\t{\n\n\t\tlet ret: string\n\n\t\tif (isX(M))\n\t\t{\n\t\t\tret = ''\n\t\t}\n\t\telse if (isX(m))\n\t\t{\n\t\t\tret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n\t\t}\n\t\telse if (isX(p))\n\t\t{\n\t\t\t// ~1.2 == >=1.2.0 <1.3.0-0\n\t\t\tret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n\t\t}\n\t\telse if (pr)\n\t\t{\n\n\t\t\tret = `>=${M}.${m}.${p}-${pr\n\t\t\t} <${M}.${+m + 1}.0-0`\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// ~1.2.3 == >=1.2.3 <1.3.0-0\n\t\t\tret = `>=${M}.${m}.${p\n\t\t\t} <${M}.${+m + 1}.0-0`\n\t\t}\n\n\t\treturn ret\n\t})\n}\n\n/**\n * ^ --> * (any, kinda silly)\n * ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n * ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n * ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n * ^1.2.3 --> >=1.2.3 <2.0.0-0\n * ^1.2.0 --> >=1.2.0 <2.0.0-0\n */\nexport function replaceCarets(comp: string, options: IOptions)\n{\n\treturn comp.trim().split(/\\s+/).map((comp) =>\n\t{\n\t\treturn replaceCaret(comp, options)\n\t}).join(' ');\n}\n\nexport function replaceCaret(comp: string, options: IOptions)\n{\n\n\tconst r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n\tconst z = options.includePrerelease ? '-0' : ''\n\treturn comp.replace(r, (_, M, m, p, pr) =>\n\t{\n\n\t\tlet ret: string\n\n\t\tif (isX(M))\n\t\t{\n\t\t\tret = ''\n\t\t}\n\t\telse if (isX(m))\n\t\t{\n\t\t\tret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n\t\t}\n\t\telse if (isX(p))\n\t\t{\n\t\t\tif (M === '0')\n\t\t\t{\n\t\t\t\tret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n\t\t\t}\n\t\t}\n\t\telse if (pr)\n\t\t{\n\n\t\t\tif (M === '0')\n\t\t\t{\n\t\t\t\tif (m === '0')\n\t\t\t\t{\n\t\t\t\t\tret = `>=${M}.${m}.${p}-${pr\n\t\t\t\t\t} <${M}.${m}.${+p + 1}-0`\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tret = `>=${M}.${m}.${p}-${pr\n\t\t\t\t\t} <${M}.${+m + 1}.0-0`\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tret = `>=${M}.${m}.${p}-${pr\n\t\t\t\t} <${+M + 1}.0.0-0`\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\tif (M === '0')\n\t\t\t{\n\t\t\t\tif (m === '0')\n\t\t\t\t{\n\t\t\t\t\tret = `>=${M}.${m}.${p\n\t\t\t\t\t}${z} <${M}.${m}.${+p + 1}-0`\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tret = `>=${M}.${m}.${p\n\t\t\t\t\t}${z} <${M}.${+m + 1}.0-0`\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tret = `>=${M}.${m}.${p\n\t\t\t\t} <${+M + 1}.0.0-0`\n\t\t\t}\n\t\t}\n\n\t\treturn ret\n\t})\n}\n\nexport function replaceXRanges(comp: string, options: IOptions)\n{\n\n\treturn comp.split(/\\s+/).map((comp) =>\n\t{\n\t\treturn replaceXRange(comp, options)\n\t}).join(' ')\n}\n\nexport function replaceXRange(comp: string, options: IOptions)\n{\n\tcomp = comp.trim()\n\tconst r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n\treturn comp.replace(r, (ret, gtlt, M, m, p, pr) =>\n\t{\n\n\t\tconst xM = isX(M)\n\t\tconst xm = xM || isX(m)\n\t\tconst xp = xm || isX(p)\n\t\tconst anyX = xp\n\n\t\tif (gtlt === '=' && anyX)\n\t\t{\n\t\t\tgtlt = ''\n\t\t}\n\n\t\t// if we're including prereleases in the match, then we need\n\t\t// to fix this to -0, the lowest possible prerelease value\n\t\tpr = options.includePrerelease ? '-0' : ''\n\n\t\tif (xM)\n\t\t{\n\t\t\tif (gtlt === '>' || gtlt === '<')\n\t\t\t{\n\t\t\t\t// nothing is allowed\n\t\t\t\tret = EnumSemverVersion.NULL\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// nothing is forbidden\n\t\t\t\tret = EnumSemverVersion.STAR\n\t\t\t}\n\t\t}\n\t\telse if (gtlt && anyX)\n\t\t{\n\t\t\t// we know patch is an x, because we have any x at all.\n\t\t\t// replace X with 0\n\t\t\tif (xm)\n\t\t\t{\n\t\t\t\tm = 0\n\t\t\t}\n\t\t\tp = 0\n\n\t\t\tif (gtlt === '>')\n\t\t\t{\n\t\t\t\t// >1 => >=2.0.0\n\t\t\t\t// >1.2 => >=1.3.0\n\t\t\t\tgtlt = '>='\n\t\t\t\tif (xm)\n\t\t\t\t{\n\t\t\t\t\tM = +M + 1\n\t\t\t\t\tm = 0\n\t\t\t\t\tp = 0\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tm = +m + 1\n\t\t\t\t\tp = 0\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (gtlt === '<=')\n\t\t\t{\n\t\t\t\t// <=0.7.x is actually <0.8.0, since any 0.7.x should\n\t\t\t\t// pass. Similarly, <=7.x is actually <8.0.0, etc.\n\t\t\t\tgtlt = '<'\n\t\t\t\tif (xm)\n\t\t\t\t{\n\t\t\t\t\tM = +M + 1\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tm = +m + 1\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (gtlt === '<')\n\t\t\t{\n\t\t\t\tpr = '-0'\n\t\t\t}\n\n\t\t\tret = `${gtlt + M}.${m}.${p}${pr}`\n\t\t}\n\t\telse if (xm)\n\t\t{\n\t\t\tret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n\t\t}\n\t\telse if (xp)\n\t\t{\n\t\t\tret = `>=${M}.${m}.0${pr\n\t\t\t} <${M}.${+m + 1}.0-0`\n\t\t}\n\n\t\treturn ret\n\t})\n}\n\n/**\n * and '' means \"any version\", just remove the *s entirely.\n */\nexport function replaceStars(comp: string, options: IOptions)\n{\n\t// Looseness is ignored here. star is always as loose as it gets!\n\treturn comp.trim().replace(re[t.STAR], '')\n}\n"]}
|
package/lib/satisfies.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.satisfies =
|
|
3
|
+
exports.satisfies = satisfies;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const satisfies_1 = tslib_1.__importDefault(require("semver/functions/satisfies"));
|
|
6
6
|
const handleAmpersandAndSpaces_1 = require("./handleAmpersandAndSpaces");
|
|
7
7
|
function satisfies(version, range, optionsOrLoose) {
|
|
8
8
|
return (0, satisfies_1.default)(version, (0, handleAmpersandAndSpaces_1.handleAmpersandAndSpaces)(range), optionsOrLoose);
|
|
9
9
|
}
|
|
10
|
-
exports.satisfies = satisfies;
|
|
11
10
|
exports.default = satisfies;
|
|
12
11
|
//# sourceMappingURL=satisfies.js.map
|
package/lib/satisfies.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"satisfies.js","sourceRoot":"","sources":["satisfies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"satisfies.js","sourceRoot":"","sources":["satisfies.ts"],"names":[],"mappings":";;AAKA,8BAGC;;AAND,mFAAyD;AACzD,yEAAsE;AAEtE,SAAgB,SAAS,CAAC,OAAwB,EAAE,KAAqB,EAAE,cAAkC;IAE5G,OAAO,IAAA,mBAAe,EAAC,OAAO,EAAE,IAAA,mDAAwB,EAAC,KAAK,CAAQ,EAAE,cAAc,CAAC,CAAA;AACxF,CAAC;AAED,kBAAe,SAAS,CAAA","sourcesContent":["import SemVer from 'semver/classes/semver';\nimport { Options } from 'semver';\nimport semverSatisfies from 'semver/functions/satisfies';\nimport { handleAmpersandAndSpaces } from './handleAmpersandAndSpaces';\n\nexport function satisfies(version: string | SemVer, range: string | Range, optionsOrLoose?: boolean | Options)\n{\n\treturn semverSatisfies(version, handleAmpersandAndSpaces(range) as any, optionsOrLoose)\n}\n\nexport default satisfies\n"]}
|
package/lib/simplifyRange.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.simplifyRange =
|
|
3
|
+
exports.simplifyRange = simplifyRange;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const simplify_1 = tslib_1.__importDefault(require("semver/ranges/simplify"));
|
|
6
6
|
const handleAmpersandAndSpaces_1 = require("./handleAmpersandAndSpaces");
|
|
7
7
|
function simplifyRange(ranges, range, options) {
|
|
8
8
|
return (0, simplify_1.default)(ranges, (0, handleAmpersandAndSpaces_1.handleAmpersandAndSpaces)(range), options);
|
|
9
9
|
}
|
|
10
|
-
exports.simplifyRange = simplifyRange;
|
|
11
10
|
exports.default = simplifyRange;
|
|
12
11
|
//# sourceMappingURL=simplifyRange.js.map
|
package/lib/simplifyRange.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simplifyRange.js","sourceRoot":"","sources":["simplifyRange.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"simplifyRange.js","sourceRoot":"","sources":["simplifyRange.ts"],"names":[],"mappings":";;AAKA,sCAIC;;AAPD,8EAAyD;AACzD,yEAAsE;AAEtE,SAAgB,aAAa,CAA4B,MAAgB,EAAE,KAAQ,EAAE,OAAiB;IAGrG,OAAO,IAAA,kBAAmB,EAAC,MAAM,EAAE,IAAA,mDAAwB,EAAC,KAAK,CAAQ,EAAE,OAAO,CAAM,CAAA;AACzF,CAAC;AAED,kBAAe,aAAa,CAAA","sourcesContent":["import SemVer from 'semver/classes/semver';\nimport { Options } from 'semver';\nimport semverSimplifyRange from 'semver/ranges/simplify';\nimport { handleAmpersandAndSpaces } from './handleAmpersandAndSpaces';\n\nexport function simplifyRange<T extends string | SemVer>(ranges: string[], range: T, options?: Options,\n)\n{\n\treturn semverSimplifyRange(ranges, handleAmpersandAndSpaces(range) as any, options) as T\n}\n\nexport default simplifyRange\n"]}
|
package/lib/util/array.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.array_sub_map =
|
|
3
|
+
exports.array_sub_map = array_sub_map;
|
|
4
4
|
function array_sub_map(listSet, callbackFn, thisArg) {
|
|
5
5
|
return listSet
|
|
6
6
|
.map((list) => {
|
|
7
7
|
return list.map(callbackFn, thisArg);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
exports.array_sub_map = array_sub_map;
|
|
11
10
|
//# sourceMappingURL=array.js.map
|
package/lib/util/array.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.js","sourceRoot":"","sources":["array.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"array.js","sourceRoot":"","sources":["array.ts"],"names":[],"mappings":";;AACA,sCAOC;AAPD,SAAgB,aAAa,CAAO,OAAc,EAAE,UAAsD,EAAE,OAAa;IAExH,OAAO,OAAO;SACZ,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IACrC,CAAC,CAAC,CACF;AACF,CAAC","sourcesContent":["\nexport function array_sub_map<U, T>(listSet: T[][], callbackFn: (value: T, index: number, array: T[]) => U, thisArg?: any)\n{\n\treturn listSet\n\t\t.map((list) => {\n\t\t\treturn list.map(callbackFn, thisArg)\n\t\t})\n\t;\n}\n"]}
|
package/lib/util/assert.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.hasInvalidCharacter = hasInvalidCharacter;
|
|
4
|
+
exports.assertInvalidCharacter = assertInvalidCharacter;
|
|
5
|
+
exports.assertInvalidComparatorSet = assertInvalidComparatorSet;
|
|
4
6
|
const parseOptionsOrLoose_1 = require("../internal/parseOptionsOrLoose");
|
|
5
7
|
const const_1 = require("../const");
|
|
6
8
|
function hasInvalidCharacter(semver, optionsOrLoose) {
|
|
@@ -8,7 +10,6 @@ function hasInvalidCharacter(semver, optionsOrLoose) {
|
|
|
8
10
|
? const_1.reInvalidCharacter
|
|
9
11
|
: const_1.reInvalidCharacterOrAmpersand).test(semver);
|
|
10
12
|
}
|
|
11
|
-
exports.hasInvalidCharacter = hasInvalidCharacter;
|
|
12
13
|
function assertInvalidCharacter(semver, optionsOrLoose) {
|
|
13
14
|
const m = semver.match((0, parseOptionsOrLoose_1.parseOptionsOrLoose)(optionsOrLoose).noAmpersand
|
|
14
15
|
? const_1.reInvalidCharacter
|
|
@@ -17,11 +18,9 @@ function assertInvalidCharacter(semver, optionsOrLoose) {
|
|
|
17
18
|
throw new TypeError(`Invalid SemVer Character: '${m[0]}' at index ${m.index} of '${semver}'`);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
exports.assertInvalidCharacter = assertInvalidCharacter;
|
|
21
21
|
function assertInvalidComparatorSet(comparatorsSet, message) {
|
|
22
22
|
if (!(comparatorsSet === null || comparatorsSet === void 0 ? void 0 : comparatorsSet.length) || !Array.isArray(comparatorsSet)) {
|
|
23
23
|
throw new TypeError(message !== null && message !== void 0 ? message : `Invalid ComparatorSet: ${comparatorsSet}`);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
exports.assertInvalidComparatorSet = assertInvalidComparatorSet;
|
|
27
26
|
//# sourceMappingURL=assert.js.map
|
package/lib/util/assert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert.js","sourceRoot":"","sources":["assert.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assert.js","sourceRoot":"","sources":["assert.ts"],"names":[],"mappings":";;AAIA,kDAOC;AAED,wDAYC;AAED,gEAMC;AAhCD,yEAAsE;AACtE,oCAA6E;AAE7E,SAAgB,mBAAmB,CAAC,MAAc,EACjD,cAAgC;IAGhC,OAAO,CAAC,IAAA,yCAAmB,EAAC,cAAc,CAAC,CAAC,WAAW;QACtD,CAAC,CAAC,0BAAkB;QACpB,CAAC,CAAC,qCAA6B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAC/C,CAAC;AAED,SAAgB,sBAAsB,CAAC,MAAc,EACpD,cAAgC;IAGhC,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAA,yCAAmB,EAAC,cAAc,CAAC,CAAC,WAAW;QACrE,CAAC,CAAC,0BAAkB;QACpB,CAAC,CAAC,qCAA6B,CAAC,CAAC;IAElC,IAAI,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,MAAM,EACb,CAAC;QACA,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,KAAK,QAAQ,MAAM,GAAG,CAAC,CAAA;IAC9F,CAAC;AACF,CAAC;AAED,SAAgB,0BAA0B,CAAC,cAAmC,EAAE,OAAgB;IAE/F,IAAI,CAAC,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,MAAM,CAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,EAC7D,CAAC;QACA,MAAM,IAAI,SAAS,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,0BAA0B,cAAc,EAAE,CAAC,CAAA;IAC3E,CAAC;AACF,CAAC","sourcesContent":["import { IComparatorSetInput, IOptionsOrLoose } from '../types';\nimport { parseOptionsOrLoose } from '../internal/parseOptionsOrLoose';\nimport { reInvalidCharacter, reInvalidCharacterOrAmpersand } from '../const';\n\nexport function hasInvalidCharacter(semver: string,\n\toptionsOrLoose?: IOptionsOrLoose,\n)\n{\n\treturn (parseOptionsOrLoose(optionsOrLoose).noAmpersand\n\t\t? reInvalidCharacter\n\t\t: reInvalidCharacterOrAmpersand).test(semver)\n}\n\nexport function assertInvalidCharacter(semver: string,\n\toptionsOrLoose?: IOptionsOrLoose,\n): asserts semver is string\n{\n\tconst m = semver.match(parseOptionsOrLoose(optionsOrLoose).noAmpersand\n\t\t? reInvalidCharacter\n\t\t: reInvalidCharacterOrAmpersand);\n\n\tif (m?.length)\n\t{\n\t\tthrow new TypeError(`Invalid SemVer Character: '${m[0]}' at index ${m.index} of '${semver}'`)\n\t}\n}\n\nexport function assertInvalidComparatorSet(comparatorsSet: IComparatorSetInput, message?: string): asserts comparatorsSet is IComparatorSetInput\n{\n\tif (!comparatorsSet?.length || !Array.isArray(comparatorsSet))\n\t{\n\t\tthrow new TypeError(message ?? `Invalid ComparatorSet: ${comparatorsSet}`)\n\t}\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.opts = void 0;
|
|
4
|
+
exports.fixBooleanProperty = fixBooleanProperty;
|
|
4
5
|
exports.opts = ['includePrerelease', 'loose', 'rtl'];
|
|
5
6
|
function fixBooleanProperty(options, fields = exports.opts, mode) {
|
|
6
7
|
fields.forEach(k => {
|
|
@@ -11,5 +12,4 @@ function fixBooleanProperty(options, fields = exports.opts, mode) {
|
|
|
11
12
|
});
|
|
12
13
|
return options;
|
|
13
14
|
}
|
|
14
|
-
exports.fixBooleanProperty = fixBooleanProperty;
|
|
15
15
|
//# sourceMappingURL=fixBooleanProperty.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixBooleanProperty.js","sourceRoot":"","sources":["fixBooleanProperty.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"fixBooleanProperty.js","sourceRoot":"","sources":["fixBooleanProperty.ts"],"names":[],"mappings":";;;AAIA,gDAeC;AAjBY,QAAA,IAAI,GAAG,CAAC,mBAAmB,EAAE,OAAO,EAAE,KAAK,CAAU,CAAA;AAElE,SAAgB,kBAAkB,CAA6B,OAAU,EACxE,SAA4C,YAAI,EAChD,IAAc;IAGd,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QAElB,IAAI,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,WAAW,IAAI,IAAI,KAAK,IAAI,EACtD,CAAC;YACA,aAAa;YACb,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAA;AACf,CAAC","sourcesContent":["import { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';\n\nexport const opts = ['includePrerelease', 'loose', 'rtl'] as const\n\nexport function fixBooleanProperty<T extends Record<any, any>>(options: T,\n\tfields: ITSArrayListMaybeReadonly<string> = opts,\n\tmode?: boolean\n)\n{\n\tfields.forEach(k =>\n\t{\n\t\tif (typeof options[k] !== 'undefined' || mode === true)\n\t\t{\n\t\t\t// @ts-ignore\n\t\t\toptions[k] = !!options[k];\n\t\t}\n\t});\n\n\treturn options\n}\n"]}
|
package/lib/util/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.hasAmpersandAndSpaces = hasAmpersandAndSpaces;
|
|
4
|
+
exports.isPlainObject = isPlainObject;
|
|
4
5
|
const const_1 = require("../const");
|
|
5
6
|
function hasAmpersandAndSpaces(input) {
|
|
6
7
|
return const_1.reAmpersandAndSpaces.test(input);
|
|
7
8
|
}
|
|
8
|
-
exports.hasAmpersandAndSpaces = hasAmpersandAndSpaces;
|
|
9
9
|
function isPlainObject(value) {
|
|
10
10
|
if (Object.prototype.toString.call(value) !== '[object Object]') {
|
|
11
11
|
return false;
|
|
@@ -13,5 +13,4 @@ function isPlainObject(value) {
|
|
|
13
13
|
const prototype = Object.getPrototypeOf(value);
|
|
14
14
|
return prototype === null || prototype === Object.prototype;
|
|
15
15
|
}
|
|
16
|
-
exports.isPlainObject = isPlainObject;
|
|
17
16
|
//# sourceMappingURL=index.js.map
|
package/lib/util/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAEA,sDAGC;AAED,sCASC;AAhBD,oCAAgD;AAEhD,SAAgB,qBAAqB,CAAC,KAAa;IAElD,OAAO,4BAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACxC,CAAC;AAED,SAAgB,aAAa,CAAC,KAAK;IAElC,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,iBAAiB,EAC/D,CAAC;QACA,OAAO,KAAK,CAAC;IACd,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC/C,OAAO,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS,CAAC;AAC7D,CAAC","sourcesContent":["import { reAmpersandAndSpaces } from '../const';\n\nexport function hasAmpersandAndSpaces(input: string)\n{\n\treturn reAmpersandAndSpaces.test(input)\n}\n\nexport function isPlainObject(value): value is object\n{\n\tif (Object.prototype.toString.call(value) !== '[object Object]')\n\t{\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === null || prototype === Object.prototype;\n}\n"]}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.stringifyComparators = stringifyComparators;
|
|
4
|
+
exports.stringifyComparatorsSet = stringifyComparatorsSet;
|
|
4
5
|
const const_1 = require("../const");
|
|
5
6
|
function stringifyComparators(comparatorsArray) {
|
|
6
7
|
return comparatorsArray.join(' ');
|
|
7
8
|
}
|
|
8
|
-
exports.stringifyComparators = stringifyComparators;
|
|
9
9
|
function stringifyComparatorsSet(comparatorsSet) {
|
|
10
10
|
return comparatorsSet
|
|
11
11
|
.map(stringifyComparators)
|
|
12
12
|
.join(const_1.separatorDoubleVerticalBar);
|
|
13
13
|
}
|
|
14
|
-
exports.stringifyComparatorsSet = stringifyComparatorsSet;
|
|
15
14
|
//# sourceMappingURL=stringifyComparators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringifyComparators.js","sourceRoot":"","sources":["stringifyComparators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stringifyComparators.js","sourceRoot":"","sources":["stringifyComparators.ts"],"names":[],"mappings":";;AAIA,oDAGC;AAED,0DAMC;AAdD,oCAAsD;AAGtD,SAAgB,oBAAoB,CAAC,gBAAuC;IAE3E,OAAO,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAClC,CAAC;AAED,SAAgB,uBAAuB,CAAC,cAAmC;IAE1E,OAAO,cAAc;SACnB,GAAG,CAAC,oBAAoB,CAAC;SACzB,IAAI,CAAC,kCAA0B,CAAC,CACjC;AACF,CAAC","sourcesContent":["\nimport { separatorDoubleVerticalBar } from '../const';\nimport { IComparatorSetInput, IComparatorArrayInput } from '../types';\n\nexport function stringifyComparators(comparatorsArray: IComparatorArrayInput)\n{\n\treturn comparatorsArray.join(' ')\n}\n\nexport function stringifyComparatorsSet(comparatorsSet: IComparatorSetInput)\n{\n\treturn comparatorsSet\n\t\t.map(stringifyComparators)\n\t\t.join(separatorDoubleVerticalBar)\n\t;\n}\n"]}
|
package/lib/validRange.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validRange =
|
|
3
|
+
exports.validRange = validRange;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const parseOptionsOrLoose_1 = require("./internal/parseOptionsOrLoose");
|
|
6
6
|
const Range_1 = tslib_1.__importDefault(require("./Range"));
|
|
@@ -22,6 +22,5 @@ function validRange(range, optionsOrLoose) {
|
|
|
22
22
|
}
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
-
exports.validRange = validRange;
|
|
26
25
|
exports.default = validRange;
|
|
27
26
|
//# sourceMappingURL=validRange.js.map
|
package/lib/validRange.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validRange.js","sourceRoot":"","sources":["validRange.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validRange.js","sourceRoot":"","sources":["validRange.ts"],"names":[],"mappings":";;AASA,gCAsBC;;AA9BD,wEAAqE;AACrE,4DAAkC;AAElC,0CAAoD;AAEpD;;GAEG;AACH,SAAgB,UAAU,CAAC,KAAa,EAAE,cAAgC;IAEzE,IAAI,OAAO,KAAK,KAAK,QAAQ,EAC7B,CAAC;QACA,MAAM,IAAI,SAAS,CAAC,mCAAmC,KAAK,EAAE,CAAC,CAAA;IAChE,CAAC;IAED,cAAc,GAAG,IAAA,yCAAmB,EAAC,cAAc,CAAC,CAAA;IAEpD,IACA,CAAC;QACA,IAAI,CAAC,IAAA,4BAAmB,EAAC,KAAK,EAAE,cAAc,CAAC,EAC/C,CAAC;YACA,OAAO,IAAI,eAAW,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,aAAa,EAAE,CAAA;QAC9D,CAAC;IACF,CAAC;IACD,OAAO,EAAE,EACT,CAAC;IAED,CAAC;IAED,OAAO,IAAI,CAAA;AACZ,CAAC;AAED,kBAAe,UAAU,CAAA","sourcesContent":["import SemVer from 'semver/classes/semver';\nimport { parseOptionsOrLoose } from './internal/parseOptionsOrLoose';\nimport SemverRange from './Range';\nimport { IOptionsOrLoose } from './types';\nimport { hasInvalidCharacter } from './util/assert';\n\n/**\n * Return the valid range or null if it's not valid\n */\nexport function validRange(range: string, optionsOrLoose?: IOptionsOrLoose)\n{\n\tif (typeof range !== 'string')\n\t{\n\t\tthrow new TypeError(`range should be string, but got ${range}`)\n\t}\n\n\toptionsOrLoose = parseOptionsOrLoose(optionsOrLoose)\n\n\ttry\n\t{\n\t\tif (!hasInvalidCharacter(range, optionsOrLoose))\n\t\t{\n\t\t\treturn new SemverRange(range, optionsOrLoose).toRangeString()\n\t\t}\n\t}\n\tcatch (er)\n\t{\n\n\t}\n\n\treturn null\n}\n\nexport default validRange\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lazy-node/semver-ampersand",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "semver with support (&)ampersand",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"semver",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"tsc:showConfig": "ynpx get-current-tsconfig -p"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"array-hyper-unique": "^2.1.
|
|
48
|
+
"array-hyper-unique": "^2.1.6",
|
|
49
49
|
"class-without-call-parent-constructor": "^2.0.5",
|
|
50
50
|
"lru-cache2": "^6.0.7",
|
|
51
51
|
"split-smartly2": "^1.1.15",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "089606f66f3c5501a8f3fdfc42e5a85b57f4d0e9"
|
|
62
62
|
}
|