@xylabs/array 3.1.13 → 3.2.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.
@@ -0,0 +1,2 @@
1
+ export declare const containsAll: <T>(source: T[], target: T[]) => boolean;
2
+ //# sourceMappingURL=containsAll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"containsAll.d.ts","sourceRoot":"","sources":["../../src/containsAll.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,cAAe,CAAC,EAAE,UAAU,CAAC,EAAE,YAA4C,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const containsAll: <T>(source: T[], target: T[]) => boolean;
2
+ //# sourceMappingURL=containsAll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"containsAll.d.ts","sourceRoot":"","sources":["../../src/containsAll.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,cAAe,CAAC,EAAE,UAAU,CAAC,EAAE,YAA4C,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const containsAll: <T>(source: T[], target: T[]) => boolean;
2
+ //# sourceMappingURL=containsAll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"containsAll.d.ts","sourceRoot":"","sources":["../../src/containsAll.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,cAAe,CAAC,EAAE,UAAU,CAAC,EAAE,YAA4C,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const distinct: <T>(value: T, index: number, array: T[]) => boolean;
2
+ //# sourceMappingURL=distinct.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distinct.d.ts","sourceRoot":"","sources":["../../src/distinct.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,aAAc,CAAC,SAAS,MAAM,SAAS,CAAC,EAAE,YAAmC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const distinct: <T>(value: T, index: number, array: T[]) => boolean;
2
+ //# sourceMappingURL=distinct.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distinct.d.ts","sourceRoot":"","sources":["../../src/distinct.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,aAAc,CAAC,SAAS,MAAM,SAAS,CAAC,EAAE,YAAmC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const distinct: <T>(value: T, index: number, array: T[]) => boolean;
2
+ //# sourceMappingURL=distinct.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distinct.d.ts","sourceRoot":"","sources":["../../src/distinct.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,aAAc,CAAC,SAAS,MAAM,SAAS,CAAC,EAAE,YAAmC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const flatten: <T>(a?: T | ConcatArray<T>, b?: T | ConcatArray<T>) => T[];
2
+ //# sourceMappingURL=flatten.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../src/flatten.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,UAAW,CAAC,GAAG,YAAY,CAAC,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,KAAG,CAAC,EAG5E,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const flatten: <T>(a?: T | ConcatArray<T>, b?: T | ConcatArray<T>) => T[];
2
+ //# sourceMappingURL=flatten.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../src/flatten.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,UAAW,CAAC,GAAG,YAAY,CAAC,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,KAAG,CAAC,EAG5E,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const flatten: <T>(a?: T | ConcatArray<T>, b?: T | ConcatArray<T>) => T[];
2
+ //# sourceMappingURL=flatten.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../src/flatten.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,UAAW,CAAC,GAAG,YAAY,CAAC,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,KAAG,CAAC,EAG5E,CAAA"}
@@ -0,0 +1,40 @@
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
+ //# 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 // eslint-disable-next-line unicorn/prefer-spread\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;AAEjF,SAAQ,CAAC,EAAwB,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,oBAAM;AACpE;","names":[]}
@@ -0,0 +1,4 @@
1
+ export * from './containsAll';
2
+ export * from './distinct';
3
+ export * from './flatten';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './containsAll';
2
+ export * from './distinct';
3
+ export * from './flatten';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './containsAll';
2
+ export * from './distinct';
3
+ export * from './flatten';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
@@ -0,0 +1,17 @@
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.js.map
@@ -0,0 +1 @@
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 // eslint-disable-next-line unicorn/prefer-spread\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;AAEjF,SAAQ,CAAC,EAAwB,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,MAAM;AACpE;","names":[]}
package/package.json CHANGED
@@ -14,25 +14,25 @@
14
14
  "exports": {
15
15
  ".": {
16
16
  "require": {
17
- "types": "./dist/node/index.d.cts",
18
- "default": "./dist/node/index.cjs"
17
+ "types": "./dist/neutral/index.d.cts",
18
+ "default": "./dist/neutral/index.cjs"
19
19
  },
20
20
  "import": {
21
- "types": "./dist/node/index.d.mts",
22
- "default": "./dist/node/index.js"
21
+ "types": "./dist/neutral/index.d.mts",
22
+ "default": "./dist/neutral/index.js"
23
23
  }
24
24
  },
25
25
  "./package.json": "./package.json"
26
26
  },
27
- "main": "./dist/node/index.cjs",
28
- "types": "./dist/node/index.d.ts",
29
- "module": "./dist/node/index.js",
27
+ "main": "./dist/neutral/index.cjs",
28
+ "types": "./dist/neutral/index.d.ts",
29
+ "module": "./dist/neutral/index.js",
30
30
  "dependencies": {
31
- "@xylabs/exists": "~3.1.13"
31
+ "@xylabs/exists": "~3.2.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@xylabs/ts-scripts-yarn3": "^3.9.1",
35
- "@xylabs/tsconfig": "^3.9.1",
34
+ "@xylabs/ts-scripts-yarn3": "^3.10.0",
35
+ "@xylabs/tsconfig": "^3.10.0",
36
36
  "typescript": "^5.4.5"
37
37
  },
38
38
  "engines": {
@@ -53,6 +53,6 @@
53
53
  "url": "https://github.com/xylabs/sdk-js.git"
54
54
  },
55
55
  "sideEffects": false,
56
- "version": "3.1.13",
56
+ "version": "3.2.0",
57
57
  "type": "module"
58
58
  }