@xylabs/set 5.0.83 → 5.0.86
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/README.md +43 -36
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/lib/difference.d.ts +6 -0
- package/dist/neutral/lib/difference.d.ts.map +1 -1
- package/dist/neutral/lib/intersection.d.ts +6 -0
- package/dist/neutral/lib/intersection.d.ts.map +1 -1
- package/dist/neutral/lib/union.d.ts +6 -0
- package/dist/neutral/lib/union.d.ts.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
|
|
17
17
|
|
|
18
|
+
|
|
19
|
+
|
|
18
20
|
## Reference
|
|
19
21
|
|
|
20
22
|
**@xylabs/set**
|
|
@@ -23,9 +25,11 @@ Base functionality used throughout XY Labs TypeScript/JavaScript libraries
|
|
|
23
25
|
|
|
24
26
|
## Functions
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
| Function | Description |
|
|
29
|
+
| ------ | ------ |
|
|
30
|
+
| [difference](#functions/difference) | Returns a new set containing elements in `a` that are not in `b`. |
|
|
31
|
+
| [intersection](#functions/intersection) | Returns a new set containing only elements present in both `a` and `b`. |
|
|
32
|
+
| [union](#functions/union) | Returns a new set containing all elements from both `a` and `b`. |
|
|
29
33
|
|
|
30
34
|
### functions
|
|
31
35
|
|
|
@@ -36,29 +40,30 @@ Base functionality used throughout XY Labs TypeScript/JavaScript libraries
|
|
|
36
40
|
***
|
|
37
41
|
|
|
38
42
|
```ts
|
|
39
|
-
function difference<TKey>(a
|
|
43
|
+
function difference<TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey>;
|
|
40
44
|
```
|
|
41
45
|
|
|
42
|
-
|
|
46
|
+
Returns a new set containing elements in `a` that are not in `b`.
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
## Type Parameters
|
|
45
49
|
|
|
46
|
-
|
|
50
|
+
| Type Parameter |
|
|
51
|
+
| ------ |
|
|
52
|
+
| `TKey` |
|
|
47
53
|
|
|
48
54
|
## Parameters
|
|
49
55
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
`Set`\<`TKey`\>
|
|
53
|
-
|
|
54
|
-
### b
|
|
55
|
-
|
|
56
|
-
`Set`\<`TKey`\>
|
|
56
|
+
| Parameter | Type | Description |
|
|
57
|
+
| ------ | ------ | ------ |
|
|
58
|
+
| `a` | `Set`\<`TKey`\> | The source set |
|
|
59
|
+
| `b` | `Set`\<`TKey`\> | The set of elements to exclude |
|
|
57
60
|
|
|
58
61
|
## Returns
|
|
59
62
|
|
|
60
63
|
`Set`\<`TKey`\>
|
|
61
64
|
|
|
65
|
+
A new set representing the difference of `a` and `b`
|
|
66
|
+
|
|
62
67
|
### <a id="intersection"></a>intersection
|
|
63
68
|
|
|
64
69
|
[**@xylabs/set**](#../README)
|
|
@@ -66,29 +71,30 @@ function difference<TKey>(a, b): Set<TKey>;
|
|
|
66
71
|
***
|
|
67
72
|
|
|
68
73
|
```ts
|
|
69
|
-
function intersection<TKey>(a
|
|
74
|
+
function intersection<TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey>;
|
|
70
75
|
```
|
|
71
76
|
|
|
72
|
-
|
|
77
|
+
Returns a new set containing only elements present in both `a` and `b`.
|
|
73
78
|
|
|
74
|
-
|
|
79
|
+
## Type Parameters
|
|
75
80
|
|
|
76
|
-
|
|
81
|
+
| Type Parameter |
|
|
82
|
+
| ------ |
|
|
83
|
+
| `TKey` |
|
|
77
84
|
|
|
78
85
|
## Parameters
|
|
79
86
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
`Set`\<`TKey`\>
|
|
83
|
-
|
|
84
|
-
### b
|
|
85
|
-
|
|
86
|
-
`Set`\<`TKey`\>
|
|
87
|
+
| Parameter | Type | Description |
|
|
88
|
+
| ------ | ------ | ------ |
|
|
89
|
+
| `a` | `Set`\<`TKey`\> | The first set |
|
|
90
|
+
| `b` | `Set`\<`TKey`\> | The second set |
|
|
87
91
|
|
|
88
92
|
## Returns
|
|
89
93
|
|
|
90
94
|
`Set`\<`TKey`\>
|
|
91
95
|
|
|
96
|
+
A new set representing the intersection of `a` and `b`
|
|
97
|
+
|
|
92
98
|
### <a id="union"></a>union
|
|
93
99
|
|
|
94
100
|
[**@xylabs/set**](#../README)
|
|
@@ -96,29 +102,30 @@ function intersection<TKey>(a, b): Set<TKey>;
|
|
|
96
102
|
***
|
|
97
103
|
|
|
98
104
|
```ts
|
|
99
|
-
function union<TKey>(a
|
|
105
|
+
function union<TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey>;
|
|
100
106
|
```
|
|
101
107
|
|
|
102
|
-
|
|
108
|
+
Returns a new set containing all elements from both `a` and `b`.
|
|
103
109
|
|
|
104
|
-
|
|
110
|
+
## Type Parameters
|
|
105
111
|
|
|
106
|
-
|
|
112
|
+
| Type Parameter |
|
|
113
|
+
| ------ |
|
|
114
|
+
| `TKey` |
|
|
107
115
|
|
|
108
116
|
## Parameters
|
|
109
117
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
`Set`\<`TKey`\>
|
|
113
|
-
|
|
114
|
-
### b
|
|
115
|
-
|
|
116
|
-
`Set`\<`TKey`\>
|
|
118
|
+
| Parameter | Type | Description |
|
|
119
|
+
| ------ | ------ | ------ |
|
|
120
|
+
| `a` | `Set`\<`TKey`\> | The first set |
|
|
121
|
+
| `b` | `Set`\<`TKey`\> | The second set |
|
|
117
122
|
|
|
118
123
|
## Returns
|
|
119
124
|
|
|
120
125
|
`Set`\<`TKey`\>
|
|
121
126
|
|
|
127
|
+
A new set representing the union of `a` and `b`
|
|
128
|
+
|
|
122
129
|
|
|
123
130
|
Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
|
|
124
131
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/difference.ts","../../src/lib/intersection.ts","../../src/lib/union.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/lib/difference.ts","../../src/lib/intersection.ts","../../src/lib/union.ts"],"sourcesContent":["/**\n * Returns a new set containing elements in `a` that are not in `b`.\n * @param a - The source set\n * @param b - The set of elements to exclude\n * @returns A new set representing the difference of `a` and `b`\n */\nexport const difference = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set([...a].filter(x => !b.has(x)))\n}\n","/**\n * Returns a new set containing only elements present in both `a` and `b`.\n * @param a - The first set\n * @param b - The second set\n * @returns A new set representing the intersection of `a` and `b`\n */\nexport const intersection = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set([...a].filter(x => b.has(x)))\n}\n","/**\n * Returns a new set containing all elements from both `a` and `b`.\n * @param a - The first set\n * @param b - The second set\n * @returns A new set representing the union of `a` and `b`\n */\nexport const union = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set([...a, ...b])\n}\n"],"mappings":";AAMO,IAAM,aAAa,CAAO,GAAc,MAA4B;AACzE,SAAO,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,OAAK,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC9C;;;ACFO,IAAM,eAAe,CAAO,GAAc,MAA4B;AAC3E,SAAO,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,OAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AAC7C;;;ACFO,IAAM,QAAQ,CAAO,GAAc,MAA4B;AACpE,SAAO,oBAAI,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;AAC7B;","names":[]}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a new set containing elements in `a` that are not in `b`.
|
|
3
|
+
* @param a - The source set
|
|
4
|
+
* @param b - The set of elements to exclude
|
|
5
|
+
* @returns A new set representing the difference of `a` and `b`
|
|
6
|
+
*/
|
|
1
7
|
export declare const difference: <TKey>(a: Set<TKey>, b: Set<TKey>) => Set<TKey>;
|
|
2
8
|
//# sourceMappingURL=difference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"difference.d.ts","sourceRoot":"","sources":["../../../src/lib/difference.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,GAAI,IAAI,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,KAAG,GAAG,CAAC,IAAI,CAErE,CAAA"}
|
|
1
|
+
{"version":3,"file":"difference.d.ts","sourceRoot":"","sources":["../../../src/lib/difference.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,IAAI,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,KAAG,GAAG,CAAC,IAAI,CAErE,CAAA"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a new set containing only elements present in both `a` and `b`.
|
|
3
|
+
* @param a - The first set
|
|
4
|
+
* @param b - The second set
|
|
5
|
+
* @returns A new set representing the intersection of `a` and `b`
|
|
6
|
+
*/
|
|
1
7
|
export declare const intersection: <TKey>(a: Set<TKey>, b: Set<TKey>) => Set<TKey>;
|
|
2
8
|
//# sourceMappingURL=intersection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intersection.d.ts","sourceRoot":"","sources":["../../../src/lib/intersection.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,GAAI,IAAI,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,KAAG,GAAG,CAAC,IAAI,CAEvE,CAAA"}
|
|
1
|
+
{"version":3,"file":"intersection.d.ts","sourceRoot":"","sources":["../../../src/lib/intersection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,IAAI,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,KAAG,GAAG,CAAC,IAAI,CAEvE,CAAA"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a new set containing all elements from both `a` and `b`.
|
|
3
|
+
* @param a - The first set
|
|
4
|
+
* @param b - The second set
|
|
5
|
+
* @returns A new set representing the union of `a` and `b`
|
|
6
|
+
*/
|
|
1
7
|
export declare const union: <TKey>(a: Set<TKey>, b: Set<TKey>) => Set<TKey>;
|
|
2
8
|
//# sourceMappingURL=union.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../../src/lib/union.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,GAAI,IAAI,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,KAAG,GAAG,CAAC,IAAI,CAEhE,CAAA"}
|
|
1
|
+
{"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../../src/lib/union.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,IAAI,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,KAAG,GAAG,CAAC,IAAI,CAEhE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/set",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.86",
|
|
4
4
|
"description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"set",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"!**/*.test.*"
|
|
43
43
|
],
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@xylabs/ts-scripts-yarn3": "~7.4.
|
|
46
|
-
"@xylabs/tsconfig": "~7.4.
|
|
45
|
+
"@xylabs/ts-scripts-yarn3": "~7.4.16",
|
|
46
|
+
"@xylabs/tsconfig": "~7.4.16",
|
|
47
47
|
"typescript": "~5.9.3",
|
|
48
48
|
"vitest": "~4.0.18"
|
|
49
49
|
},
|