@xylabs/array 2.11.24 → 2.12.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/dist/node/containsAll.cjs +31 -0
- package/dist/node/containsAll.cjs.map +1 -0
- package/dist/node/containsAll.js +2 -27
- package/dist/node/containsAll.js.map +1 -1
- package/dist/node/distinct.cjs +31 -0
- package/dist/node/distinct.cjs.map +1 -0
- package/dist/node/distinct.js +2 -27
- package/dist/node/distinct.js.map +1 -1
- package/dist/node/flatten.cjs +34 -0
- package/dist/node/{flatten.mjs.map → flatten.cjs.map} +1 -1
- package/dist/node/flatten.js +4 -29
- package/dist/node/flatten.js.map +1 -1
- package/dist/node/index.cjs +46 -0
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.js +4 -33
- package/dist/node/index.js.map +1 -1
- package/package.json +8 -7
- package/dist/node/containsAll.mjs +0 -6
- package/dist/node/containsAll.mjs.map +0 -1
- package/dist/node/distinct.mjs +0 -6
- package/dist/node/distinct.mjs.map +0 -1
- package/dist/node/flatten.mjs +0 -9
- package/dist/node/index.mjs +0 -17
- package/dist/node/index.mjs.map +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/containsAll.ts
|
|
21
|
+
var containsAll_exports = {};
|
|
22
|
+
__export(containsAll_exports, {
|
|
23
|
+
containsAll: () => containsAll
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(containsAll_exports);
|
|
26
|
+
var containsAll = (source, target) => target.every((i) => source.includes(i));
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
containsAll
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=containsAll.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/containsAll.ts"],"sourcesContent":["export const containsAll = <T>(source: T[], target: T[]) => target.every((i) => source.includes(i))\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,cAAc,CAAI,QAAa,WAAgB,OAAO,MAAM,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;","names":[]}
|
package/dist/node/containsAll.js
CHANGED
|
@@ -1,31 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
1
|
// src/containsAll.ts
|
|
21
|
-
var containsAll_exports = {};
|
|
22
|
-
__export(containsAll_exports, {
|
|
23
|
-
containsAll: () => containsAll
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(containsAll_exports);
|
|
26
2
|
var containsAll = (source, target) => target.every((i) => source.includes(i));
|
|
27
|
-
|
|
28
|
-
0 && (module.exports = {
|
|
3
|
+
export {
|
|
29
4
|
containsAll
|
|
30
|
-
}
|
|
5
|
+
};
|
|
31
6
|
//# sourceMappingURL=containsAll.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/containsAll.ts"],"sourcesContent":["export const containsAll = <T>(source: T[], target: T[]) => target.every((i) => source.includes(i))\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/containsAll.ts"],"sourcesContent":["export const containsAll = <T>(source: T[], target: T[]) => target.every((i) => source.includes(i))\n"],"mappings":";AAAO,IAAM,cAAc,CAAI,QAAa,WAAgB,OAAO,MAAM,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;","names":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/distinct.ts
|
|
21
|
+
var distinct_exports = {};
|
|
22
|
+
__export(distinct_exports, {
|
|
23
|
+
distinct: () => distinct
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(distinct_exports);
|
|
26
|
+
var distinct = (value, index, array) => array.indexOf(value) === index;
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
distinct
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=distinct.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/distinct.ts"],"sourcesContent":["export const distinct = <T>(value: T, index: number, array: T[]) => array.indexOf(value) === index\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,WAAW,CAAI,OAAU,OAAe,UAAe,MAAM,QAAQ,KAAK,MAAM;","names":[]}
|
package/dist/node/distinct.js
CHANGED
|
@@ -1,31 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
1
|
// src/distinct.ts
|
|
21
|
-
var distinct_exports = {};
|
|
22
|
-
__export(distinct_exports, {
|
|
23
|
-
distinct: () => distinct
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(distinct_exports);
|
|
26
2
|
var distinct = (value, index, array) => array.indexOf(value) === index;
|
|
27
|
-
|
|
28
|
-
0 && (module.exports = {
|
|
3
|
+
export {
|
|
29
4
|
distinct
|
|
30
|
-
}
|
|
5
|
+
};
|
|
31
6
|
//# sourceMappingURL=distinct.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/distinct.ts"],"sourcesContent":["export const distinct = <T>(value: T, index: number, array: T[]) => array.indexOf(value) === index\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/distinct.ts"],"sourcesContent":["export const distinct = <T>(value: T, index: number, array: T[]) => array.indexOf(value) === index\n"],"mappings":";AAAO,IAAM,WAAW,CAAI,OAAU,OAAe,UAAe,MAAM,QAAQ,KAAK,MAAM;","names":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/flatten.ts
|
|
21
|
+
var flatten_exports = {};
|
|
22
|
+
__export(flatten_exports, {
|
|
23
|
+
flatten: () => flatten
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(flatten_exports);
|
|
26
|
+
var import_exists = require("@xylabs/exists");
|
|
27
|
+
var flatten = (a, b) => {
|
|
28
|
+
return [].concat(a).concat(b).filter(import_exists.exists);
|
|
29
|
+
};
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
flatten
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=flatten.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/flatten.ts"],"sourcesContent":["import { exists } from '@xylabs/exists'\n\nexport const flatten = <T>(a?: T | ConcatArray<T>, b?: T | ConcatArray<T>): T[] => {\n return ([] as (T | undefined)[]).concat(a).concat(b).filter(exists)\n}\n"],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/flatten.ts"],"sourcesContent":["import { exists } from '@xylabs/exists'\n\nexport const flatten = <T>(a?: T | ConcatArray<T>, b?: T | ConcatArray<T>): T[] => {\n return ([] as (T | undefined)[]).concat(a).concat(b).filter(exists)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AAEhB,IAAM,UAAU,CAAI,GAAwB,MAAgC;AACjF,SAAQ,CAAC,EAAwB,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,oBAAM;AACpE;","names":[]}
|
package/dist/node/flatten.js
CHANGED
|
@@ -1,34 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
1
|
// src/flatten.ts
|
|
21
|
-
|
|
22
|
-
__export(flatten_exports, {
|
|
23
|
-
flatten: () => flatten
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(flatten_exports);
|
|
26
|
-
var import_exists = require("@xylabs/exists");
|
|
2
|
+
import { exists } from "@xylabs/exists";
|
|
27
3
|
var flatten = (a, b) => {
|
|
28
|
-
return [].concat(a).concat(b).filter(
|
|
4
|
+
return [].concat(a).concat(b).filter(exists);
|
|
29
5
|
};
|
|
30
|
-
|
|
31
|
-
0 && (module.exports = {
|
|
6
|
+
export {
|
|
32
7
|
flatten
|
|
33
|
-
}
|
|
8
|
+
};
|
|
34
9
|
//# sourceMappingURL=flatten.js.map
|
package/dist/node/flatten.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/flatten.ts"],"sourcesContent":["import { exists } from '@xylabs/exists'\n\nexport const flatten = <T>(a?: T | ConcatArray<T>, b?: T | ConcatArray<T>): T[] => {\n return ([] as (T | undefined)[]).concat(a).concat(b).filter(exists)\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/flatten.ts"],"sourcesContent":["import { exists } from '@xylabs/exists'\n\nexport const flatten = <T>(a?: T | ConcatArray<T>, b?: T | ConcatArray<T>): T[] => {\n return ([] as (T | undefined)[]).concat(a).concat(b).filter(exists)\n}\n"],"mappings":";AAAA,SAAS,cAAc;AAEhB,IAAM,UAAU,CAAI,GAAwB,MAAgC;AACjF,SAAQ,CAAC,EAAwB,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,MAAM;AACpE;","names":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
containsAll: () => containsAll,
|
|
24
|
+
distinct: () => distinct,
|
|
25
|
+
flatten: () => flatten
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(src_exports);
|
|
28
|
+
|
|
29
|
+
// src/containsAll.ts
|
|
30
|
+
var containsAll = (source, target) => target.every((i) => source.includes(i));
|
|
31
|
+
|
|
32
|
+
// src/distinct.ts
|
|
33
|
+
var distinct = (value, index, array) => array.indexOf(value) === index;
|
|
34
|
+
|
|
35
|
+
// src/flatten.ts
|
|
36
|
+
var import_exists = require("@xylabs/exists");
|
|
37
|
+
var flatten = (a, b) => {
|
|
38
|
+
return [].concat(a).concat(b).filter(import_exists.exists);
|
|
39
|
+
};
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
containsAll,
|
|
43
|
+
distinct,
|
|
44
|
+
flatten
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/containsAll.ts","../../src/distinct.ts","../../src/flatten.ts"],"sourcesContent":["export * from './containsAll'\nexport * from './distinct'\nexport * from './flatten'\n","export const containsAll = <T>(source: T[], target: T[]) => target.every((i) => source.includes(i))\n","export const distinct = <T>(value: T, index: number, array: T[]) => array.indexOf(value) === index\n","import { exists } from '@xylabs/exists'\n\nexport const flatten = <T>(a?: T | ConcatArray<T>, b?: T | ConcatArray<T>): T[] => {\n return ([] as (T | undefined)[]).concat(a).concat(b).filter(exists)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,cAAc,CAAI,QAAa,WAAgB,OAAO,MAAM,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;;;ACA3F,IAAM,WAAW,CAAI,OAAU,OAAe,UAAe,MAAM,QAAQ,KAAK,MAAM;;;ACA7F,oBAAuB;AAEhB,IAAM,UAAU,CAAI,GAAwB,MAAgC;AACjF,SAAQ,CAAC,EAAwB,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,oBAAM;AACpE;","names":[]}
|
package/dist/node/index.js
CHANGED
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
containsAll: () => containsAll,
|
|
24
|
-
distinct: () => distinct,
|
|
25
|
-
flatten: () => flatten
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(src_exports);
|
|
28
|
-
|
|
29
1
|
// src/containsAll.ts
|
|
30
2
|
var containsAll = (source, target) => target.every((i) => source.includes(i));
|
|
31
3
|
|
|
@@ -33,14 +5,13 @@ var containsAll = (source, target) => target.every((i) => source.includes(i));
|
|
|
33
5
|
var distinct = (value, index, array) => array.indexOf(value) === index;
|
|
34
6
|
|
|
35
7
|
// src/flatten.ts
|
|
36
|
-
|
|
8
|
+
import { exists } from "@xylabs/exists";
|
|
37
9
|
var flatten = (a, b) => {
|
|
38
|
-
return [].concat(a).concat(b).filter(
|
|
10
|
+
return [].concat(a).concat(b).filter(exists);
|
|
39
11
|
};
|
|
40
|
-
|
|
41
|
-
0 && (module.exports = {
|
|
12
|
+
export {
|
|
42
13
|
containsAll,
|
|
43
14
|
distinct,
|
|
44
15
|
flatten
|
|
45
|
-
}
|
|
16
|
+
};
|
|
46
17
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/
|
|
1
|
+
{"version":3,"sources":["../../src/containsAll.ts","../../src/distinct.ts","../../src/flatten.ts"],"sourcesContent":["export const containsAll = <T>(source: T[], target: T[]) => target.every((i) => source.includes(i))\n","export const distinct = <T>(value: T, index: number, array: T[]) => array.indexOf(value) === index\n","import { exists } from '@xylabs/exists'\n\nexport const flatten = <T>(a?: T | ConcatArray<T>, b?: T | ConcatArray<T>): T[] => {\n return ([] as (T | undefined)[]).concat(a).concat(b).filter(exists)\n}\n"],"mappings":";AAAO,IAAM,cAAc,CAAI,QAAa,WAAgB,OAAO,MAAM,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;;;ACA3F,IAAM,WAAW,CAAI,OAAU,OAAe,UAAe,MAAM,QAAQ,KAAK,MAAM;;;ACA7F,SAAS,cAAc;AAEhB,IAAM,UAAU,CAAI,GAAwB,MAAgC;AACjF,SAAQ,CAAC,EAAwB,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,MAAM;AACpE;","names":[]}
|
package/package.json
CHANGED
|
@@ -12,16 +12,15 @@
|
|
|
12
12
|
},
|
|
13
13
|
"description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
|
|
14
14
|
"docs": "dist/docs.json",
|
|
15
|
-
"types": "dist/node/index.d.ts",
|
|
16
15
|
"exports": {
|
|
17
16
|
".": {
|
|
18
17
|
"require": {
|
|
19
18
|
"types": "./dist/node/index.d.ts",
|
|
20
|
-
"default": "./dist/node/index.
|
|
19
|
+
"default": "./dist/node/index.cjs"
|
|
21
20
|
},
|
|
22
21
|
"import": {
|
|
23
22
|
"types": "./dist/node/index.d.mts",
|
|
24
|
-
"default": "./dist/node/index.
|
|
23
|
+
"default": "./dist/node/index.js"
|
|
25
24
|
}
|
|
26
25
|
},
|
|
27
26
|
"./docs": {
|
|
@@ -29,10 +28,11 @@
|
|
|
29
28
|
},
|
|
30
29
|
"./package.json": "./package.json"
|
|
31
30
|
},
|
|
32
|
-
"main": "dist/node/index.
|
|
33
|
-
"
|
|
31
|
+
"main": "./dist/node/index.cjs",
|
|
32
|
+
"types": "./dist/node/index.d.ts",
|
|
33
|
+
"module": "./dist/node/index.js",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@xylabs/exists": "~2.
|
|
35
|
+
"@xylabs/exists": "~2.12.2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@xylabs/ts-scripts-yarn3": "^3.0.74",
|
|
@@ -54,5 +54,6 @@
|
|
|
54
54
|
"url": "https://github.com/xylabs/sdk-js.git"
|
|
55
55
|
},
|
|
56
56
|
"sideEffects": false,
|
|
57
|
-
"version": "2.
|
|
57
|
+
"version": "2.12.2",
|
|
58
|
+
"type": "module"
|
|
58
59
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/containsAll.ts"],"sourcesContent":["export const containsAll = <T>(source: T[], target: T[]) => target.every((i) => source.includes(i))\n"],"mappings":";AAAO,IAAM,cAAc,CAAI,QAAa,WAAgB,OAAO,MAAM,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;","names":[]}
|
package/dist/node/distinct.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/distinct.ts"],"sourcesContent":["export const distinct = <T>(value: T, index: number, array: T[]) => array.indexOf(value) === index\n"],"mappings":";AAAO,IAAM,WAAW,CAAI,OAAU,OAAe,UAAe,MAAM,QAAQ,KAAK,MAAM;","names":[]}
|
package/dist/node/flatten.mjs
DELETED
package/dist/node/index.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// src/containsAll.ts
|
|
2
|
-
var containsAll = (source, target) => target.every((i) => source.includes(i));
|
|
3
|
-
|
|
4
|
-
// src/distinct.ts
|
|
5
|
-
var distinct = (value, index, array) => array.indexOf(value) === index;
|
|
6
|
-
|
|
7
|
-
// src/flatten.ts
|
|
8
|
-
import { exists } from "@xylabs/exists";
|
|
9
|
-
var flatten = (a, b) => {
|
|
10
|
-
return [].concat(a).concat(b).filter(exists);
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
containsAll,
|
|
14
|
-
distinct,
|
|
15
|
-
flatten
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/node/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/containsAll.ts","../../src/distinct.ts","../../src/flatten.ts"],"sourcesContent":["export const containsAll = <T>(source: T[], target: T[]) => target.every((i) => source.includes(i))\n","export const distinct = <T>(value: T, index: number, array: T[]) => array.indexOf(value) === index\n","import { exists } from '@xylabs/exists'\n\nexport const flatten = <T>(a?: T | ConcatArray<T>, b?: T | ConcatArray<T>): T[] => {\n return ([] as (T | undefined)[]).concat(a).concat(b).filter(exists)\n}\n"],"mappings":";AAAO,IAAM,cAAc,CAAI,QAAa,WAAgB,OAAO,MAAM,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;;;ACA3F,IAAM,WAAW,CAAI,OAAU,OAAe,UAAe,MAAM,QAAQ,KAAK,MAAM;;;ACA7F,SAAS,cAAc;AAEhB,IAAM,UAAU,CAAI,GAAwB,MAAgC;AACjF,SAAQ,CAAC,EAAwB,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,MAAM;AACpE;","names":[]}
|