@lazy-node/semver-ampersand 1.0.29 → 2.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 +49 -0
- package/lib/Range.d.ts +1 -1
- package/lib/Range.js +2 -2
- package/lib/Range.js.map +1 -1
- package/lib/range/buildRangeSet.d.ts +2 -0
- package/lib/range/buildRangeSet.js +20 -0
- package/lib/range/buildRangeSet.js.map +1 -0
- package/lib/range/normalizeRangeInput.d.ts +2 -0
- package/lib/range/normalizeRangeInput.js +26 -0
- package/lib/range/normalizeRangeInput.js.map +1 -0
- package/lib/range/parseRange.d.ts +0 -2
- package/lib/range/parseRange.js +3 -35
- package/lib/range/parseRange.js.map +1 -1
- package/lib/range/stringifyRangeSet.d.ts +2 -0
- package/lib/range/stringifyRangeSet.js +8 -0
- package/lib/range/stringifyRangeSet.js.map +1 -0
- package/lib/types.d.ts +7 -7
- package/lib/types.js.map +1 -1
- package/lib/util/split.js +3 -4
- package/lib/util/split.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,55 @@
|
|
|
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
|
+
## [2.0.2](https://github.com/bluelovers/ws-yarn-workspaces/compare/@lazy-node/semver-ampersand@2.0.1...@lazy-node/semver-ampersand@2.0.2) (2022-08-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update type ([e7a1c05](https://github.com/bluelovers/ws-yarn-workspaces/commit/e7a1c057edd99dffe81622a5f456a86aa89111c6))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### 📦 Code Refactoring
|
|
15
|
+
|
|
16
|
+
* code splitting and update test ([7f2cbbb](https://github.com/bluelovers/ws-yarn-workspaces/commit/7f2cbbb4813832fa88bd844a55300e119cc3e7b4))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### 🚨 Tests
|
|
20
|
+
|
|
21
|
+
* update jest.config.js and deps ([d1d501b](https://github.com/bluelovers/ws-yarn-workspaces/commit/d1d501ba059130bd8f90e6eaa266084110698011))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### 📌 Dependencies
|
|
25
|
+
|
|
26
|
+
* update deps ([58501f9](https://github.com/bluelovers/ws-yarn-workspaces/commit/58501f97494eb624779dffea7ac9d68e45e5e978))
|
|
27
|
+
* update deps ([a0b8755](https://github.com/bluelovers/ws-yarn-workspaces/commit/a0b875582efdc9829b0cdb6c9c819cace8b76e90))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [2.0.1](https://github.com/bluelovers/ws-yarn-workspaces/compare/@lazy-node/semver-ampersand@2.0.0...@lazy-node/semver-ampersand@2.0.1) (2022-07-31)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### 🚨 Tests
|
|
37
|
+
|
|
38
|
+
* **preset:** use `@bluelovers/jest-config` ([e239ecf](https://github.com/bluelovers/ws-yarn-workspaces/commit/e239ecf606d82930c6036ec1241bf3b4a1095423))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# [2.0.0](https://github.com/bluelovers/ws-yarn-workspaces/compare/@lazy-node/semver-ampersand@1.0.29...@lazy-node/semver-ampersand@2.0.0) (2022-07-07)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### ♻️ Dependencies
|
|
48
|
+
|
|
49
|
+
* update deps ([aff04a4](https://github.com/bluelovers/ws-yarn-workspaces/commit/aff04a47e24f963121cf893a03a5b92dfcb6b720))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
6
55
|
## [1.0.29](https://github.com/bluelovers/ws-yarn-workspaces/compare/@lazy-node/semver-ampersand@1.0.25...@lazy-node/semver-ampersand@1.0.29) (2022-06-28)
|
|
7
56
|
|
|
8
57
|
|
package/lib/Range.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare class SemverRange<RAW extends ISemverRangeInput> extends SemverRa
|
|
|
10
10
|
readonly options: IOptions;
|
|
11
11
|
readonly loose: boolean;
|
|
12
12
|
readonly includePrerelease: boolean;
|
|
13
|
-
constructor(rawSource: RAW, optionsOrLoose?: IOptionsOrLoose);
|
|
13
|
+
constructor(rawSource: RAW, optionsOrLoose?: IOptionsOrLoose<IOptions>);
|
|
14
14
|
protected _buildComparatorsSet(range: string, options: IOptions): IComparatorSetInput;
|
|
15
15
|
parseRange(range: string): readonly Comparator[];
|
|
16
16
|
protected _inherit(range: ISemverRangeInput, options: IOptions): {
|
package/lib/Range.js
CHANGED
|
@@ -6,7 +6,7 @@ const range_1 = tslib_1.__importDefault(require("semver/classes/range"));
|
|
|
6
6
|
const handleAmpersandAndSpaces_1 = require("./handleAmpersandAndSpaces");
|
|
7
7
|
const stringifyComparators_1 = require("./util/stringifyComparators");
|
|
8
8
|
const semver_1 = tslib_1.__importDefault(require("semver/classes/semver"));
|
|
9
|
-
const class_without_call_parent_constructor_1 =
|
|
9
|
+
const class_without_call_parent_constructor_1 = require("class-without-call-parent-constructor");
|
|
10
10
|
const semver_2 = require("semver");
|
|
11
11
|
const options_1 = require("./range/options");
|
|
12
12
|
const toRangeString_1 = require("./range/toRangeString");
|
|
@@ -15,7 +15,7 @@ const fixComparatorSet_1 = require("./range/fixComparatorSet");
|
|
|
15
15
|
const parseOptionsOrLoose_1 = require("./internal/parseOptionsOrLoose");
|
|
16
16
|
const split_1 = require("./util/split");
|
|
17
17
|
const parseRange_1 = require("./range/parseRange");
|
|
18
|
-
class SemverRange extends (0, class_without_call_parent_constructor_1.
|
|
18
|
+
class SemverRange extends (0, class_without_call_parent_constructor_1.classWithoutCallParentConstructor)(range_1.default) {
|
|
19
19
|
constructor(rawSource, optionsOrLoose) {
|
|
20
20
|
// skip original semverRange constructor
|
|
21
21
|
super();
|
package/lib/Range.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Range.js","sourceRoot":"","sources":["Range.ts"],"names":[],"mappings":";;;;AAAA,yEAA+C;AAC/C,yEAAsE;
|
|
1
|
+
{"version":3,"file":"Range.js","sourceRoot":"","sources":["Range.ts"],"names":[],"mappings":"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","sourcesContent":["import semverRange from 'semver/classes/range';\nimport { handleAmpersandAndSpaces } from './handleAmpersandAndSpaces';\nimport {\n\tIComparatorSet,\n\tIComparatorSetInput,\n\tIOptions,\n\tIOptionsOrLoose,\n\tISemverRangeInput,\n} from './types';\nimport { stringifyComparatorsSet } from './util/stringifyComparators';\nimport SemVer from 'semver/classes/semver';\nimport { classWithoutCallParentConstructor } from 'class-without-call-parent-constructor';\nimport { Comparator } from 'semver';\nimport { _copyOptions, _isSameOptions, _normalizeOptions } from './range/options';\nimport { toRangeString } from './range/toRangeString';\nimport { assertInvalidComparatorSet } from './util/assert';\nimport { fixComparatorSet } from './range/fixComparatorSet';\nimport { parseOptionsOrLoose } from './internal/parseOptionsOrLoose';\nimport { splitDoubleVerticalBar } from './util/split';\nimport { parseRange } from './range/parseRange';\n\nexport class SemverRange<RAW extends ISemverRangeInput> extends classWithoutCallParentConstructor(semverRange)\n{\n\treadonly rawSource?: RAW;\n\n\toverride readonly range: string;\n\toverride readonly raw: string;\n\toverride readonly set: IComparatorSet;\n\n\toverride readonly options: IOptions;\n\toverride readonly loose: boolean;\n\toverride readonly includePrerelease: boolean;\n\n\tconstructor(rawSource: RAW, optionsOrLoose?: IOptionsOrLoose<IOptions>)\n\t{\n\t\t// skip original semverRange constructor\n\t\tsuper();\n\n\t\toptionsOrLoose = parseOptionsOrLoose(optionsOrLoose);\n\n\t\tlet { range, options, set } = this._inherit(rawSource, optionsOrLoose);\n\n\t\tif (typeof rawSource === 'string' && range !== rawSource)\n\t\t{\n\t\t\tthis.rawSource = rawSource;\n\t\t}\n\n\t\tthis._inheritOptions(options);\n\n\t\tif (!set)\n\t\t{\n\n\t\t\tset = this._buildComparatorsSet(range, options);\n\t\t}\n\n\t\tassertInvalidComparatorSet(set, `Invalid SemVer Range: ${range}`);\n\n\t\tset = fixComparatorSet(set, options.unsafeOptimize);\n\n\t\tassertInvalidComparatorSet(set);\n\n\t\tthis.raw = range;\n\t\tthis.set = set;\n\n\t\tthis.format()\n\t}\n\n\tprotected _buildComparatorsSet(range: string, options: IOptions): IComparatorSetInput\n\t{\n\t\tlet comparatorsSet = splitDoubleVerticalBar(range)\n\t\t\t// map the range to a 2d array of comparators\n\t\t\t.map(range => this.parseRange(range))\n\t\t\t// throw out any comparator lists that are empty\n\t\t\t// this generally means that it was not a valid range, which is allowed\n\t\t\t// in loose mode, but will still throw if the WHOLE range is invalid.\n\t\t\t.filter(c => c.length)\n\t\t;\n\n\t\treturn comparatorsSet\n\t}\n\n\toverride parseRange(range: string)\n\t{\n\t\treturn parseRange(range, this.options)\n\t}\n\n\tprotected _inherit(range: ISemverRangeInput, options: IOptions)\n\t{\n\t\tlet set: IComparatorSet;\n\n\t\tif (range instanceof semverRange)\n\t\t{\n\t\t\toptions = {\n\t\t\t\tloose: range.loose,\n\t\t\t\tincludePrerelease: range.includePrerelease,\n\t\t\t\t...range.options,\n\t\t\t\t...options,\n\t\t\t}\n\n\t\t\toptions = _normalizeOptions(options);\n\n\t\t\tif (_isSameOptions(range, options))\n\t\t\t{\n\t\t\t\tset = range.set;\n\t\t\t}\n\n\t\t\trange = range.raw;\n\t\t}\n\n\t\tif (range instanceof Comparator)\n\t\t{\n\t\t\tset = [[range]];\n\t\t\trange = range.value\n\t\t}\n\t\telse if (range instanceof SemVer)\n\t\t{\n\t\t\trange = range.format();\n\t\t}\n\n\t\tif (set?.length === 0)\n\t\t{\n\t\t\tassertInvalidComparatorSet(set);\n\t\t}\n\n\t\toptions = _normalizeOptions(options);\n\n\t\trange = handleAmpersandAndSpaces(range, options);\n\n\t\treturn {\n\t\t\trange,\n\t\t\toptions,\n\t\t\tset,\n\t\t}\n\t}\n\n\tprotected _inheritOptions(options: IOptions)\n\t{\n\t\t(this as any as semverRange).options = options;\n\t\t_copyOptions(this, options);\n\t}\n\n\toverride format()\n\t{\n\t\t(this as any as semverRange).range = stringifyComparatorsSet(this.set);\n\t\treturn this.range\n\t}\n\n\t/**\n\t * Return '*' instead of '' so that truthiness works.\n\t */\n\ttoRangeString()\n\t{\n\t\treturn toRangeString(this.range)\n\t}\n\n}\n\nexport { SemverRange as Range }\n\nexport default SemverRange\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildRangeSet = void 0;
|
|
4
|
+
const split_1 = require("../util/split");
|
|
5
|
+
const array_hyper_unique_1 = require("array-hyper-unique");
|
|
6
|
+
const handleAmpersandAndSpaces_1 = require("../handleAmpersandAndSpaces");
|
|
7
|
+
const normalizeRangeInput_1 = require("./normalizeRangeInput");
|
|
8
|
+
function buildRangeSet(range, options = {}) {
|
|
9
|
+
range = (0, handleAmpersandAndSpaces_1.handleAmpersandAndSpaces)(range, options);
|
|
10
|
+
let rangeSet = (0, split_1.splitDoubleVerticalBar)(range)
|
|
11
|
+
// map the range to a 2d array of comparators
|
|
12
|
+
.map(range => {
|
|
13
|
+
range = (0, normalizeRangeInput_1.normalizeRangeInput)(range, options);
|
|
14
|
+
return (0, split_1.splitSpace)(range);
|
|
15
|
+
});
|
|
16
|
+
rangeSet = (0, array_hyper_unique_1.array_unique_overwrite)(rangeSet);
|
|
17
|
+
return rangeSet;
|
|
18
|
+
}
|
|
19
|
+
exports.buildRangeSet = buildRangeSet;
|
|
20
|
+
//# sourceMappingURL=buildRangeSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildRangeSet.js","sourceRoot":"","sources":["buildRangeSet.ts"],"names":[],"mappings":";;;AACA,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;AAjBD,sCAiBC","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"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeRangeInput = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const re_1 = require("semver/internal/re");
|
|
6
|
+
const util_1 = require("./util");
|
|
7
|
+
const debug_1 = tslib_1.__importDefault(require("semver/internal/debug"));
|
|
8
|
+
const const_1 = require("../const");
|
|
9
|
+
function normalizeRangeInput(range, options) {
|
|
10
|
+
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
|
11
|
+
const hr = options.loose ? re_1.re[re_1.t.HYPHENRANGELOOSE] : re_1.re[re_1.t.HYPHENRANGE];
|
|
12
|
+
range = range.replace(hr, (0, util_1.hyphenReplace)(options.includePrerelease));
|
|
13
|
+
(0, debug_1.default)('hyphen replace', range);
|
|
14
|
+
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
|
15
|
+
range = range.replace(re_1.re[re_1.t.COMPARATORTRIM], re_1.comparatorTrimReplace);
|
|
16
|
+
(0, debug_1.default)('comparator trim', range, re_1.re[re_1.t.COMPARATORTRIM]);
|
|
17
|
+
// `~ 1.2.3` => `~1.2.3`
|
|
18
|
+
range = range.replace(re_1.re[re_1.t.TILDETRIM], re_1.tildeTrimReplace);
|
|
19
|
+
// `^ 1.2.3` => `^1.2.3`
|
|
20
|
+
range = range.replace(re_1.re[re_1.t.CARETTRIM], re_1.caretTrimReplace);
|
|
21
|
+
// normalize spaces
|
|
22
|
+
range = range.replace(const_1.reSpaces, ' ');
|
|
23
|
+
return range;
|
|
24
|
+
}
|
|
25
|
+
exports.normalizeRangeInput = normalizeRangeInput;
|
|
26
|
+
//# sourceMappingURL=normalizeRangeInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeRangeInput.js","sourceRoot":"","sources":["normalizeRangeInput.ts"],"names":[],"mappings":";;;;AACA,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;AApBD,kDAoBC","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"]}
|
|
@@ -5,7 +5,6 @@ import { IOptions } from '../types';
|
|
|
5
5
|
* this is a very hot path, and fully deterministic.
|
|
6
6
|
*/
|
|
7
7
|
export declare function getMemoOpts(options: IOptions): string;
|
|
8
|
-
export declare function normalizeRangeInput(range: string, options: IOptions): string;
|
|
9
8
|
export declare function normalizeRangeInputForComparator(range: string, options: IOptions): string[];
|
|
10
9
|
export declare function parseRangeCore(range: string, options: IOptions): ReadonlyArray<Comparator>;
|
|
11
10
|
/**
|
|
@@ -19,4 +18,3 @@ export declare function filterRangeListForComparator(rangeList: string[], option
|
|
|
19
18
|
*/
|
|
20
19
|
export declare function reduceComparatorList(compList: Comparator[]): Comparator[];
|
|
21
20
|
export declare function parseRange(range: string, options: IOptions): ReadonlyArray<Comparator>;
|
|
22
|
-
export declare function buildRangeSet(range: string, options?: IOptions): string[][];
|
package/lib/range/parseRange.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
3
|
+
exports.parseRange = exports.reduceComparatorList = exports.filterRangeListForComparator = exports.parseRangeCore = exports.normalizeRangeInputForComparator = exports.getMemoOpts = void 0;
|
|
5
4
|
const cache_1 = require("./cache");
|
|
6
5
|
const semver_1 = require("semver");
|
|
7
6
|
const detect_1 = require("../comparator/detect");
|
|
8
7
|
const re_1 = require("semver/internal/re");
|
|
9
|
-
const debug_1 = tslib_1.__importDefault(require("semver/internal/debug"));
|
|
10
8
|
const util_1 = require("./util");
|
|
11
9
|
const split_1 = require("../util/split");
|
|
12
10
|
const array_hyper_unique_1 = require("array-hyper-unique");
|
|
13
|
-
const
|
|
14
|
-
const handleAmpersandAndSpaces_1 = require("../handleAmpersandAndSpaces");
|
|
11
|
+
const normalizeRangeInput_1 = require("./normalizeRangeInput");
|
|
15
12
|
/**
|
|
16
13
|
* memoize range parsing for performance.
|
|
17
14
|
* this is a very hot path, and fully deterministic.
|
|
@@ -20,23 +17,6 @@ function getMemoOpts(options) {
|
|
|
20
17
|
return Object.keys(options).filter(k => options[k]).join(',');
|
|
21
18
|
}
|
|
22
19
|
exports.getMemoOpts = getMemoOpts;
|
|
23
|
-
function normalizeRangeInput(range, options) {
|
|
24
|
-
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
|
25
|
-
const hr = options.loose ? re_1.re[re_1.t.HYPHENRANGELOOSE] : re_1.re[re_1.t.HYPHENRANGE];
|
|
26
|
-
range = range.replace(hr, (0, util_1.hyphenReplace)(options.includePrerelease));
|
|
27
|
-
(0, debug_1.default)('hyphen replace', range);
|
|
28
|
-
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
|
29
|
-
range = range.replace(re_1.re[re_1.t.COMPARATORTRIM], re_1.comparatorTrimReplace);
|
|
30
|
-
(0, debug_1.default)('comparator trim', range, re_1.re[re_1.t.COMPARATORTRIM]);
|
|
31
|
-
// `~ 1.2.3` => `~1.2.3`
|
|
32
|
-
range = range.replace(re_1.re[re_1.t.TILDETRIM], re_1.tildeTrimReplace);
|
|
33
|
-
// `^ 1.2.3` => `^1.2.3`
|
|
34
|
-
range = range.replace(re_1.re[re_1.t.CARETTRIM], re_1.caretTrimReplace);
|
|
35
|
-
// normalize spaces
|
|
36
|
-
range = range.replace(const_1.reSpaces, ' ');
|
|
37
|
-
return range;
|
|
38
|
-
}
|
|
39
|
-
exports.normalizeRangeInput = normalizeRangeInput;
|
|
40
20
|
function normalizeRangeInputForComparator(range, options) {
|
|
41
21
|
let rangeList = (0, split_1.splitSpace)(range)
|
|
42
22
|
.map(comp => (0, util_1.parseComparator)(comp, options));
|
|
@@ -47,7 +27,7 @@ function normalizeRangeInputForComparator(range, options) {
|
|
|
47
27
|
}
|
|
48
28
|
exports.normalizeRangeInputForComparator = normalizeRangeInputForComparator;
|
|
49
29
|
function parseRangeCore(range, options) {
|
|
50
|
-
range = normalizeRangeInput(range, options);
|
|
30
|
+
range = (0, normalizeRangeInput_1.normalizeRangeInput)(range, options);
|
|
51
31
|
// At this point, the range is completely trimmed and
|
|
52
32
|
// ready to be split into comparators.
|
|
53
33
|
let rangeList = normalizeRangeInputForComparator(range, options);
|
|
@@ -104,16 +84,4 @@ function parseRange(range, options) {
|
|
|
104
84
|
return result;
|
|
105
85
|
}
|
|
106
86
|
exports.parseRange = parseRange;
|
|
107
|
-
function buildRangeSet(range, options = {}) {
|
|
108
|
-
range = (0, handleAmpersandAndSpaces_1.handleAmpersandAndSpaces)(range, options);
|
|
109
|
-
let rangeSet = (0, split_1.splitDoubleVerticalBar)(range)
|
|
110
|
-
// map the range to a 2d array of comparators
|
|
111
|
-
.map(range => {
|
|
112
|
-
range = normalizeRangeInput(range, options);
|
|
113
|
-
return (0, split_1.splitSpace)(range);
|
|
114
|
-
});
|
|
115
|
-
rangeSet = (0, array_hyper_unique_1.array_unique_overwrite)(rangeSet);
|
|
116
|
-
return rangeSet;
|
|
117
|
-
}
|
|
118
|
-
exports.buildRangeSet = buildRangeSet;
|
|
119
87
|
//# 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":"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","sourcesContent":["import { cache } from './cache';\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"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stringifyRangeSet = void 0;
|
|
4
|
+
function stringifyRangeSet(rangeSet) {
|
|
5
|
+
return rangeSet.flat().join(' ');
|
|
6
|
+
}
|
|
7
|
+
exports.stringifyRangeSet = stringifyRangeSet;
|
|
8
|
+
//# sourceMappingURL=stringifyRangeSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stringifyRangeSet.js","sourceRoot":"","sources":["stringifyRangeSet.ts"],"names":[],"mappings":";;;AAEA,SAAgB,iBAAiB,CAAC,QAA0C;IAE3E,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACjC,CAAC;AAHD,8CAGC","sourcesContent":["import { buildRangeSet } from './buildRangeSet';\n\nexport function stringifyRangeSet(rangeSet: ReturnType<typeof buildRangeSet>)\n{\n\treturn rangeSet.flat().join(' ')\n}\n"]}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Options, Range } from 'semver';
|
|
1
|
+
import { Options, Range, RangeOptions } from 'semver';
|
|
2
2
|
import semverRange from 'semver/classes/range';
|
|
3
3
|
import SemVer from 'semver/classes/semver';
|
|
4
4
|
import SemverRange from './Range';
|
|
5
5
|
import { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';
|
|
6
6
|
import Comparator from 'semver/classes/comparator';
|
|
7
|
-
export interface IOptions extends Options {
|
|
7
|
+
export interface IOptions extends Options, RangeOptions {
|
|
8
8
|
noAmpersand?: boolean;
|
|
9
9
|
unsafeOptimize?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
11
|
+
export type IOptionsOrLoose<T extends Options = IOptions> = boolean | T;
|
|
12
|
+
export type IComparatorSet = Range["set"];
|
|
13
|
+
export type IComparatorArrayInput = ITSArrayListMaybeReadonly<Comparator>;
|
|
14
|
+
export type IComparatorSetInput = ITSArrayListMaybeReadonly<IComparatorArrayInput>;
|
|
15
|
+
export type ISemverRangeInput = string | SemverRange<any> | semverRange | SemVer | Comparator;
|
package/lib/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, Range } from 'semver';\nimport semverRange from 'semver/classes/range';\nimport SemVer from 'semver/classes/semver';\nimport SemverRange from './Range';\nimport { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';\nimport Comparator from 'semver/classes/comparator';\n\nexport interface IOptions extends Options\n{\n\tnoAmpersand?: boolean,\n\tunsafeOptimize?: boolean,\n}\n\nexport type IOptionsOrLoose<T extends Options = IOptions> = boolean | T\n\nexport type IComparatorSet = Range[\"set\"];\n\nexport type IComparatorArrayInput = ITSArrayListMaybeReadonly<Comparator>;\n\nexport type IComparatorSetInput = ITSArrayListMaybeReadonly<IComparatorArrayInput>;\n\nexport type ISemverRangeInput = string | SemverRange<any> | semverRange | SemVer | Comparator;\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, Range, RangeOptions } from 'semver';\nimport semverRange from 'semver/classes/range';\nimport SemVer from 'semver/classes/semver';\nimport SemverRange from './Range';\nimport { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';\nimport Comparator from 'semver/classes/comparator';\n\nexport interface IOptions extends Options, RangeOptions\n{\n\tnoAmpersand?: boolean,\n\tunsafeOptimize?: boolean,\n}\n\nexport type IOptionsOrLoose<T extends Options = IOptions> = boolean | T\n\nexport type IComparatorSet = Range[\"set\"];\n\nexport type IComparatorArrayInput = ITSArrayListMaybeReadonly<Comparator>;\n\nexport type IComparatorSetInput = ITSArrayListMaybeReadonly<IComparatorArrayInput>;\n\nexport type ISemverRangeInput = string | SemverRange<any> | semverRange | SemVer | Comparator;\n"]}
|
package/lib/util/split.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.splitSpace = exports.splitDoubleVerticalBar = void 0;
|
|
4
|
-
const
|
|
5
|
-
const split_smartly2_1 = tslib_1.__importDefault(require("split-smartly2"));
|
|
4
|
+
const split_smartly2_1 = require("split-smartly2");
|
|
6
5
|
const const_1 = require("../const");
|
|
7
|
-
exports.splitDoubleVerticalBar = (0, split_smartly2_1.
|
|
6
|
+
exports.splitDoubleVerticalBar = (0, split_smartly2_1.splitSmartly)(const_1.reDoubleVerticalBar, {
|
|
8
7
|
includeSeparatorMode: "NONE" /* EnumIncludeSeparatorMode.INCLUDE_SEPARATOR_NONE */,
|
|
9
8
|
brackets: true,
|
|
10
9
|
});
|
|
11
|
-
exports.splitSpace = (0, split_smartly2_1.
|
|
10
|
+
exports.splitSpace = (0, split_smartly2_1.splitSmartly)(const_1.reSpaces, {
|
|
12
11
|
includeSeparatorMode: "NONE" /* EnumIncludeSeparatorMode.INCLUDE_SEPARATOR_NONE */,
|
|
13
12
|
brackets: true,
|
|
14
13
|
});
|
package/lib/util/split.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split.js","sourceRoot":"","sources":["split.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"split.js","sourceRoot":"","sources":["split.ts"],"names":[],"mappings":";;;AAAA,mDAAwE;AACxE,oCAAyD;AAE5C,QAAA,sBAAsB,GAAG,IAAA,6BAAY,EAAC,2BAAmB,EAAE;IACvE,oBAAoB,8DAAiD;IACrE,QAAQ,EAAE,IAAI;CACd,CAA8B,CAAC;AAEnB,QAAA,UAAU,GAAG,IAAA,6BAAY,EAAC,gBAAQ,EAAE;IAChD,oBAAoB,8DAAiD;IACrE,QAAQ,EAAE,IAAI;CACd,CAA8B,CAAC","sourcesContent":["import { splitSmartly, EnumIncludeSeparatorMode } from 'split-smartly2';\nimport { reDoubleVerticalBar, reSpaces } from '../const';\n\nexport const splitDoubleVerticalBar = splitSmartly(reDoubleVerticalBar, {\n\tincludeSeparatorMode: EnumIncludeSeparatorMode.INCLUDE_SEPARATOR_NONE,\n\tbrackets: true,\n}) as (str: string) => string[];\n\nexport const splitSpace = splitSmartly(reSpaces, {\n\tincludeSeparatorMode: EnumIncludeSeparatorMode.INCLUDE_SEPARATOR_NONE,\n\tbrackets: true,\n}) as (str: string) => string[];\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lazy-node/semver-ampersand",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "semver with support (&)ampersand",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"semver",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"array-hyper-unique": "^2.0.8",
|
|
42
42
|
"class-without-call-parent-constructor": "^2.0.4",
|
|
43
43
|
"lru-cache2": "^6.0.7",
|
|
44
|
-
"split-smartly2": "^1.1.
|
|
45
|
-
"ts-type": "^2.1.
|
|
44
|
+
"split-smartly2": "^1.1.12",
|
|
45
|
+
"ts-type": "^2.1.10",
|
|
46
46
|
"tslib": "^2"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "e34c95f09bf1ad26e3a721028a28f6b8bfb44510"
|
|
55
55
|
}
|