syncpack 6.0.0 → 6.1.0
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/dist/bin-fix-mismatches/fix-mismatches.js +3 -10
- package/dist/bin-fix-mismatches/{get-highest-version.d.ts → get-expected-version/get-highest-version.d.ts} +1 -1
- package/dist/bin-fix-mismatches/{get-highest-version.js → get-expected-version/get-highest-version.js} +22 -22
- package/dist/bin-fix-mismatches/get-expected-version/get-pinned-version.d.ts +2 -0
- package/dist/bin-fix-mismatches/get-expected-version/get-pinned-version.js +7 -0
- package/dist/bin-fix-mismatches/{get-workspace-version.d.ts → get-expected-version/get-workspace-version.d.ts} +1 -1
- package/dist/bin-fix-mismatches/{get-workspace-version.js → get-expected-version/get-workspace-version.js} +0 -0
- package/dist/bin-fix-mismatches/get-expected-version/index.d.ts +3 -0
- package/dist/bin-fix-mismatches/get-expected-version/index.js +15 -0
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +1 -13
- package/dist/bin-list/list-version-groups.d.ts +9 -3
- package/dist/bin-list/list-version-groups.js +9 -3
- package/dist/bin-list/list.d.ts +0 -7
- package/dist/bin-list/list.js +3 -5
- package/dist/bin-list-mismatches/list-mismatches.js +6 -6
- package/dist/bin-set-semver-ranges/set-semver-ranges.js +1 -13
- package/dist/constants.d.ts +4 -0
- package/dist/lib/get-input/get-instances.js +2 -0
- package/package.json +1 -1
- package/dist/lib/matches-filter.d.ts +0 -3
- package/dist/lib/matches-filter.js +0 -10
|
@@ -10,10 +10,8 @@ exports.__esModule = true;
|
|
|
10
10
|
exports.fixMismatches = void 0;
|
|
11
11
|
var chalk_1 = __importDefault(require("chalk"));
|
|
12
12
|
var list_version_groups_1 = require("../bin-list/list-version-groups");
|
|
13
|
-
var matches_filter_1 = require("../lib/matches-filter");
|
|
14
13
|
var write_if_changed_1 = require("../lib/write-if-changed");
|
|
15
|
-
var
|
|
16
|
-
var get_workspace_version_1 = require("./get-workspace-version");
|
|
14
|
+
var get_expected_version_1 = require("./get-expected-version");
|
|
17
15
|
function fixMismatches(input, disk) {
|
|
18
16
|
/**
|
|
19
17
|
* Reverse the list so the default/ungrouped version group is rendered first
|
|
@@ -22,19 +20,14 @@ function fixMismatches(input, disk) {
|
|
|
22
20
|
*/
|
|
23
21
|
input.instances.versionGroups.reverse().forEach(function (versionGroup, i) {
|
|
24
22
|
var isVersionGroup = i > 0;
|
|
25
|
-
var
|
|
26
|
-
var groups = (0, list_version_groups_1.listVersionGroups)(filtered);
|
|
23
|
+
var groups = (0, list_version_groups_1.listVersionGroups)(versionGroup);
|
|
27
24
|
if (isVersionGroup) {
|
|
28
25
|
console.log((0, chalk_1["default"])(templateObject_1 || (templateObject_1 = __makeTemplateObject(["{dim = Version Group ", " ", "}"], ["{dim = Version Group ", " ", "}"])), i, '='.repeat(63)));
|
|
29
26
|
}
|
|
30
27
|
groups.forEach(function (_a) {
|
|
31
28
|
var hasMismatches = _a.hasMismatches, instances = _a.instances, name = _a.name;
|
|
32
29
|
if (hasMismatches) {
|
|
33
|
-
var nextVersion_1 = (0,
|
|
34
|
-
(0, get_highest_version_1.getHighestVersion)(instances.map(function (_a) {
|
|
35
|
-
var version = _a.version;
|
|
36
|
-
return version;
|
|
37
|
-
}));
|
|
30
|
+
var nextVersion_1 = (0, get_expected_version_1.getExpectedVersion)(name, versionGroup, input);
|
|
38
31
|
instances.forEach(function (_a) {
|
|
39
32
|
var dependencyType = _a.dependencyType, version = _a.version, wrapper = _a.wrapper;
|
|
40
33
|
var root = wrapper.contents;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getHighestVersion(versions: string[]): string
|
|
1
|
+
export declare function getHighestVersion(versions: string[]): string;
|
|
@@ -2,13 +2,28 @@
|
|
|
2
2
|
exports.__esModule = true;
|
|
3
3
|
exports.getHighestVersion = void 0;
|
|
4
4
|
var semver_1 = require("semver");
|
|
5
|
-
var constants_1 = require("
|
|
6
|
-
var is_semver_1 = require("
|
|
7
|
-
function
|
|
8
|
-
return
|
|
5
|
+
var constants_1 = require("../../constants");
|
|
6
|
+
var is_semver_1 = require("../../lib/is-semver");
|
|
7
|
+
function getHighestVersion(versions) {
|
|
8
|
+
return versions.reduce(function (rawHighest, raw) {
|
|
9
|
+
var version = (0, semver_1.valid)((0, semver_1.coerce)(raw)) || '';
|
|
10
|
+
var highest = (0, semver_1.valid)((0, semver_1.coerce)(rawHighest)) || '';
|
|
11
|
+
if (raw === '*' || rawHighest === '*')
|
|
12
|
+
return '*';
|
|
13
|
+
if (!(0, is_semver_1.isSemver)(raw) || version === '')
|
|
14
|
+
return rawHighest;
|
|
15
|
+
if (highest === '')
|
|
16
|
+
return raw;
|
|
17
|
+
if ((0, semver_1.gt)(version, highest))
|
|
18
|
+
return raw;
|
|
19
|
+
if ((0, semver_1.eq)(version, highest) && getRangeScore(raw) > getRangeScore(rawHighest))
|
|
20
|
+
return raw;
|
|
21
|
+
return rawHighest;
|
|
22
|
+
}, '');
|
|
9
23
|
}
|
|
24
|
+
exports.getHighestVersion = getHighestVersion;
|
|
10
25
|
function getRangeScore(version) {
|
|
11
|
-
if (version ===
|
|
26
|
+
if (version === '')
|
|
12
27
|
return 0;
|
|
13
28
|
if (version === constants_1.RANGE_ANY)
|
|
14
29
|
return 8;
|
|
@@ -31,21 +46,6 @@ function getRangeScore(version) {
|
|
|
31
46
|
return 0;
|
|
32
47
|
return 0;
|
|
33
48
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
36
|
-
var version = (0, semver_1.valid)((0, semver_1.coerce)(raw));
|
|
37
|
-
var highest = (0, semver_1.valid)((0, semver_1.coerce)(rawHighest));
|
|
38
|
-
if (raw === '*' || rawHighest === '*')
|
|
39
|
-
return '*';
|
|
40
|
-
if (!(0, is_semver_1.isSemver)(raw) || version === null)
|
|
41
|
-
return rawHighest;
|
|
42
|
-
if (highest === null)
|
|
43
|
-
return raw;
|
|
44
|
-
if ((0, semver_1.gt)(version, highest))
|
|
45
|
-
return raw;
|
|
46
|
-
if ((0, semver_1.eq)(version, highest) && getRangeScore(raw) > getRangeScore(rawHighest))
|
|
47
|
-
return raw;
|
|
48
|
-
return rawHighest;
|
|
49
|
-
}, null);
|
|
49
|
+
function getRange(version) {
|
|
50
|
+
return version.slice(0, version.search(/[0-9]/));
|
|
50
51
|
}
|
|
51
|
-
exports.getHighestVersion = getHighestVersion;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SourceWrapper } from '
|
|
1
|
+
import type { SourceWrapper } from '../../lib/get-input/get-wrappers';
|
|
2
2
|
/**
|
|
3
3
|
* If the dependency `name` is a package developed locally in this monorepo, we
|
|
4
4
|
* should use its version as the source of truth.
|
|
File without changes
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ProgramInput } from '../../lib/get-input';
|
|
2
|
+
import type { IndexedVersionGroup } from '../../lib/get-input/get-instances';
|
|
3
|
+
export declare function getExpectedVersion(name: string, versionGroup: Pick<IndexedVersionGroup, 'instances' | 'pinVersion'>, input: Pick<ProgramInput, 'wrappers'>): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.getExpectedVersion = void 0;
|
|
4
|
+
var get_highest_version_1 = require("./get-highest-version");
|
|
5
|
+
var get_pinned_version_1 = require("./get-pinned-version");
|
|
6
|
+
var get_workspace_version_1 = require("./get-workspace-version");
|
|
7
|
+
function getExpectedVersion(name, versionGroup, input) {
|
|
8
|
+
return ((0, get_pinned_version_1.getPinnedVersion)(versionGroup) ||
|
|
9
|
+
(0, get_workspace_version_1.getWorkspaceVersion)(name, input.wrappers) ||
|
|
10
|
+
(0, get_highest_version_1.getHighestVersion)(versionGroup.instances.map(function (_a) {
|
|
11
|
+
var version = _a.version;
|
|
12
|
+
return version;
|
|
13
|
+
})));
|
|
14
|
+
}
|
|
15
|
+
exports.getExpectedVersion = getExpectedVersion;
|
|
@@ -3,24 +3,12 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
6
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
8
|
};
|
|
20
9
|
exports.__esModule = true;
|
|
21
10
|
exports.lintSemverRanges = void 0;
|
|
22
11
|
var chalk_1 = __importDefault(require("chalk"));
|
|
23
|
-
var matches_filter_1 = require("../lib/matches-filter");
|
|
24
12
|
var set_semver_range_1 = require("../lib/set-semver-range");
|
|
25
13
|
var list_semver_group_mismatches_1 = require("./list-semver-group-mismatches");
|
|
26
14
|
function lintSemverRanges(input) {
|
|
@@ -32,7 +20,7 @@ function lintSemverRanges(input) {
|
|
|
32
20
|
*/
|
|
33
21
|
input.instances.semverGroups.reverse().forEach(function (semverGroup, i) {
|
|
34
22
|
var isSemverGroup = i > 0;
|
|
35
|
-
var mismatches = (0, list_semver_group_mismatches_1.listSemverGroupMismatches)(
|
|
23
|
+
var mismatches = (0, list_semver_group_mismatches_1.listSemverGroupMismatches)(semverGroup);
|
|
36
24
|
if (isSemverGroup) {
|
|
37
25
|
console.log((0, chalk_1["default"])(templateObject_1 || (templateObject_1 = __makeTemplateObject(["{dim = Semver Group ", " ", "}"], ["{dim = Semver Group ", " ", "}"])), i, '='.repeat(63)));
|
|
38
26
|
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import type { Instance } from '../lib/get-input/get-instances';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { IndexedVersionGroup, Instance } from '../lib/get-input/get-instances';
|
|
2
|
+
interface ListItem {
|
|
3
|
+
hasMismatches: boolean;
|
|
4
|
+
instances: Instance[];
|
|
5
|
+
name: string;
|
|
6
|
+
uniques: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare function listVersionGroups(versionGroup: IndexedVersionGroup): ListItem[];
|
|
9
|
+
export {};
|
|
@@ -17,18 +17,24 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
17
17
|
};
|
|
18
18
|
exports.__esModule = true;
|
|
19
19
|
exports.listVersionGroups = void 0;
|
|
20
|
+
var expect_more_1 = require("expect-more");
|
|
20
21
|
var group_by_1 = require("../lib/group-by");
|
|
21
22
|
var sort_by_name_1 = require("../lib/sort-by-name");
|
|
22
|
-
function listVersionGroups(
|
|
23
|
-
var instancesByName = (0, group_by_1.groupBy)('name', instances.sort(sort_by_name_1.sortByName));
|
|
23
|
+
function listVersionGroups(versionGroup) {
|
|
24
|
+
var instancesByName = (0, group_by_1.groupBy)('name', versionGroup.instances.sort(sort_by_name_1.sortByName));
|
|
24
25
|
return Object.entries(instancesByName).map(function (_a) {
|
|
25
26
|
var _b = __read(_a, 2), name = _b[0], instances = _b[1];
|
|
27
|
+
var pinnedVersion = versionGroup.pinVersion;
|
|
28
|
+
var hasPinnedVersion = (0, expect_more_1.isNonEmptyString)(pinnedVersion);
|
|
26
29
|
var versions = instances.map(function (_a) {
|
|
27
30
|
var version = _a.version;
|
|
28
31
|
return version;
|
|
29
32
|
});
|
|
30
33
|
var uniques = Array.from(new Set(versions));
|
|
31
|
-
var hasMismatches =
|
|
34
|
+
var hasMismatches = versions.some(function (version, i) {
|
|
35
|
+
return (hasPinnedVersion && version !== pinnedVersion) ||
|
|
36
|
+
(i > 0 && version !== versions[i - 1]);
|
|
37
|
+
});
|
|
32
38
|
return {
|
|
33
39
|
hasMismatches: hasMismatches,
|
|
34
40
|
instances: instances,
|
package/dist/bin-list/list.d.ts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
import type { ProgramInput } from '../lib/get-input';
|
|
2
|
-
import type { Instance } from '../lib/get-input/get-instances';
|
|
3
|
-
export interface ListItem {
|
|
4
|
-
hasMismatches: boolean;
|
|
5
|
-
instances: Instance[];
|
|
6
|
-
name: string;
|
|
7
|
-
uniques: string[];
|
|
8
|
-
}
|
|
9
2
|
export declare function list(input: ProgramInput): void;
|
package/dist/bin-list/list.js
CHANGED
|
@@ -9,7 +9,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
exports.__esModule = true;
|
|
10
10
|
exports.list = void 0;
|
|
11
11
|
var chalk_1 = __importDefault(require("chalk"));
|
|
12
|
-
var matches_filter_1 = require("../lib/matches-filter");
|
|
13
12
|
var list_version_groups_1 = require("./list-version-groups");
|
|
14
13
|
function list(input) {
|
|
15
14
|
var isInvalid = false;
|
|
@@ -20,18 +19,17 @@ function list(input) {
|
|
|
20
19
|
*/
|
|
21
20
|
input.instances.versionGroups.reverse().forEach(function (versionGroup, i) {
|
|
22
21
|
var isVersionGroup = i > 0;
|
|
23
|
-
var
|
|
24
|
-
var ungrouped = (0, list_version_groups_1.listVersionGroups)(filtered);
|
|
22
|
+
var groups = (0, list_version_groups_1.listVersionGroups)(versionGroup);
|
|
25
23
|
if (isVersionGroup) {
|
|
26
24
|
console.log((0, chalk_1["default"])(templateObject_1 || (templateObject_1 = __makeTemplateObject(["{dim = Version Group ", " ", "}"], ["{dim = Version Group ", " ", "}"])), i, '='.repeat(63)));
|
|
27
25
|
}
|
|
28
|
-
|
|
26
|
+
groups.forEach(function (_a) {
|
|
29
27
|
var hasMismatches = _a.hasMismatches, name = _a.name, uniques = _a.uniques;
|
|
30
28
|
var versionList = uniques.sort().join(', ');
|
|
31
29
|
console.log(hasMismatches
|
|
32
30
|
? (0, chalk_1["default"])(templateObject_2 || (templateObject_2 = __makeTemplateObject(["{red \u2715 ", "} {dim.red ", "}"], ["{red \u2715 ", "} {dim.red ", "}"])), name, versionList) : (0, chalk_1["default"])(templateObject_3 || (templateObject_3 = __makeTemplateObject(["{dim -} {white ", "} {dim ", "}"], ["{dim -} {white ", "} {dim ", "}"])), name, versionList));
|
|
33
31
|
});
|
|
34
|
-
if (
|
|
32
|
+
if (groups.some(function (_a) {
|
|
35
33
|
var hasMismatches = _a.hasMismatches;
|
|
36
34
|
return hasMismatches;
|
|
37
35
|
})) {
|
|
@@ -9,8 +9,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
exports.__esModule = true;
|
|
10
10
|
exports.listMismatches = void 0;
|
|
11
11
|
var chalk_1 = __importDefault(require("chalk"));
|
|
12
|
+
var get_expected_version_1 = require("../bin-fix-mismatches/get-expected-version");
|
|
12
13
|
var list_version_groups_1 = require("../bin-list/list-version-groups");
|
|
13
|
-
var matches_filter_1 = require("../lib/matches-filter");
|
|
14
14
|
function listMismatches(input) {
|
|
15
15
|
var isInvalid = false;
|
|
16
16
|
/**
|
|
@@ -20,18 +20,18 @@ function listMismatches(input) {
|
|
|
20
20
|
*/
|
|
21
21
|
input.instances.versionGroups.reverse().forEach(function (versionGroup, i) {
|
|
22
22
|
var isVersionGroup = i > 0;
|
|
23
|
-
var
|
|
24
|
-
var ungrouped = (0, list_version_groups_1.listVersionGroups)(filtered);
|
|
23
|
+
var groups = (0, list_version_groups_1.listVersionGroups)(versionGroup);
|
|
25
24
|
if (isVersionGroup) {
|
|
26
25
|
console.log((0, chalk_1["default"])(templateObject_1 || (templateObject_1 = __makeTemplateObject(["{dim = Version Group ", " ", "}"], ["{dim = Version Group ", " ", "}"])), i, '='.repeat(63)));
|
|
27
26
|
}
|
|
28
|
-
|
|
27
|
+
groups.forEach(function (_a) {
|
|
29
28
|
var hasMismatches = _a.hasMismatches, instances = _a.instances, name = _a.name;
|
|
30
29
|
if (hasMismatches) {
|
|
31
|
-
|
|
30
|
+
var expectedVersion = (0, get_expected_version_1.getExpectedVersion)(name, versionGroup, input);
|
|
31
|
+
console.log((0, chalk_1["default"])(templateObject_2 || (templateObject_2 = __makeTemplateObject(["{dim -} ", " {green.dim ", "}"], ["{dim -} ", " {green.dim ", "}"])), name, expectedVersion));
|
|
32
32
|
instances.forEach(function (_a) {
|
|
33
33
|
var dependencyType = _a.dependencyType, version = _a.version, wrapper = _a.wrapper;
|
|
34
|
-
console.log((0, chalk_1["default"])(templateObject_3 || (templateObject_3 = __makeTemplateObject(["{
|
|
34
|
+
console.log((0, chalk_1["default"])(templateObject_3 || (templateObject_3 = __makeTemplateObject(["{red ", " {dim in ", " of ", "}}"], ["{red ", " {dim in ", " of ", "}}"])), version, dependencyType, wrapper.contents.name));
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
});
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
exports.__esModule = true;
|
|
14
3
|
exports.setSemverRanges = void 0;
|
|
15
4
|
var list_semver_group_mismatches_1 = require("../bin-lint-semver-ranges/list-semver-group-mismatches");
|
|
16
|
-
var matches_filter_1 = require("../lib/matches-filter");
|
|
17
5
|
var set_semver_range_1 = require("../lib/set-semver-range");
|
|
18
6
|
var write_if_changed_1 = require("../lib/write-if-changed");
|
|
19
7
|
var setSemverRanges = function (input, disk) {
|
|
20
8
|
input.instances.semverGroups.reverse().forEach(function (semverGroup) {
|
|
21
|
-
var mismatches = (0, list_semver_group_mismatches_1.listSemverGroupMismatches)(
|
|
9
|
+
var mismatches = (0, list_semver_group_mismatches_1.listSemverGroupMismatches)(semverGroup);
|
|
22
10
|
mismatches.forEach(function (_a) {
|
|
23
11
|
var dependencyType = _a.dependencyType, name = _a.name, version = _a.version, wrapper = _a.wrapper;
|
|
24
12
|
var root = wrapper.contents;
|
package/dist/constants.d.ts
CHANGED
|
@@ -26,6 +26,10 @@ export interface VersionGroup {
|
|
|
26
26
|
* the names of the dependencies (eg. "lodash") which belong to this group
|
|
27
27
|
*/
|
|
28
28
|
dependencies: string[];
|
|
29
|
+
/**
|
|
30
|
+
* optionally force all dependencies in this group to have this version
|
|
31
|
+
*/
|
|
32
|
+
pinVersion?: string;
|
|
29
33
|
}
|
|
30
34
|
export declare type SyncpackConfig = Readonly<{
|
|
31
35
|
/**
|
|
@@ -68,6 +68,8 @@ function getInstances(options, wrappers) {
|
|
|
68
68
|
var _g = __read(pkgs_1_1.value, 2), name = _g[0], version = _g[1];
|
|
69
69
|
if (!(0, expect_more_1.isNonEmptyString)(name))
|
|
70
70
|
continue;
|
|
71
|
+
if (name.search(new RegExp(options.filter)) === -1)
|
|
72
|
+
continue;
|
|
71
73
|
if (!(0, expect_more_1.isNonEmptyString)(version))
|
|
72
74
|
continue;
|
|
73
75
|
var instance = { dependencyType: dependencyType, name: name, version: version, wrapper: wrapper };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "syncpack",
|
|
3
3
|
"description": "Manage multiple package.json files, such as in Lerna Monorepos and Yarn/Pnpm Workspaces",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.1.0",
|
|
5
5
|
"author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)",
|
|
6
6
|
"bin": {
|
|
7
7
|
"syncpack": "dist/bin.js",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.__esModule = true;
|
|
3
|
-
exports.matchesFilter = void 0;
|
|
4
|
-
function matchesFilter(input) {
|
|
5
|
-
return function hasNameMatchingFilter(_a) {
|
|
6
|
-
var name = _a.name;
|
|
7
|
-
return name.search(new RegExp(input.filter)) !== -1;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
exports.matchesFilter = matchesFilter;
|