@xylabs/set 5.0.82 → 5.0.84
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 +24 -0
- 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
|
@@ -39,6 +39,8 @@ Base functionality used throughout XY Labs TypeScript/JavaScript libraries
|
|
|
39
39
|
function difference<TKey>(a, b): Set<TKey>;
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
Returns a new set containing elements in `a` that are not in `b`.
|
|
43
|
+
|
|
42
44
|
## Type Parameters
|
|
43
45
|
|
|
44
46
|
### TKey
|
|
@@ -51,14 +53,20 @@ function difference<TKey>(a, b): Set<TKey>;
|
|
|
51
53
|
|
|
52
54
|
`Set`\<`TKey`\>
|
|
53
55
|
|
|
56
|
+
The source set
|
|
57
|
+
|
|
54
58
|
### b
|
|
55
59
|
|
|
56
60
|
`Set`\<`TKey`\>
|
|
57
61
|
|
|
62
|
+
The set of elements to exclude
|
|
63
|
+
|
|
58
64
|
## Returns
|
|
59
65
|
|
|
60
66
|
`Set`\<`TKey`\>
|
|
61
67
|
|
|
68
|
+
A new set representing the difference of `a` and `b`
|
|
69
|
+
|
|
62
70
|
### <a id="intersection"></a>intersection
|
|
63
71
|
|
|
64
72
|
[**@xylabs/set**](#../README)
|
|
@@ -69,6 +77,8 @@ function difference<TKey>(a, b): Set<TKey>;
|
|
|
69
77
|
function intersection<TKey>(a, b): Set<TKey>;
|
|
70
78
|
```
|
|
71
79
|
|
|
80
|
+
Returns a new set containing only elements present in both `a` and `b`.
|
|
81
|
+
|
|
72
82
|
## Type Parameters
|
|
73
83
|
|
|
74
84
|
### TKey
|
|
@@ -81,14 +91,20 @@ function intersection<TKey>(a, b): Set<TKey>;
|
|
|
81
91
|
|
|
82
92
|
`Set`\<`TKey`\>
|
|
83
93
|
|
|
94
|
+
The first set
|
|
95
|
+
|
|
84
96
|
### b
|
|
85
97
|
|
|
86
98
|
`Set`\<`TKey`\>
|
|
87
99
|
|
|
100
|
+
The second set
|
|
101
|
+
|
|
88
102
|
## Returns
|
|
89
103
|
|
|
90
104
|
`Set`\<`TKey`\>
|
|
91
105
|
|
|
106
|
+
A new set representing the intersection of `a` and `b`
|
|
107
|
+
|
|
92
108
|
### <a id="union"></a>union
|
|
93
109
|
|
|
94
110
|
[**@xylabs/set**](#../README)
|
|
@@ -99,6 +115,8 @@ function intersection<TKey>(a, b): Set<TKey>;
|
|
|
99
115
|
function union<TKey>(a, b): Set<TKey>;
|
|
100
116
|
```
|
|
101
117
|
|
|
118
|
+
Returns a new set containing all elements from both `a` and `b`.
|
|
119
|
+
|
|
102
120
|
## Type Parameters
|
|
103
121
|
|
|
104
122
|
### TKey
|
|
@@ -111,14 +129,20 @@ function union<TKey>(a, b): Set<TKey>;
|
|
|
111
129
|
|
|
112
130
|
`Set`\<`TKey`\>
|
|
113
131
|
|
|
132
|
+
The first set
|
|
133
|
+
|
|
114
134
|
### b
|
|
115
135
|
|
|
116
136
|
`Set`\<`TKey`\>
|
|
117
137
|
|
|
138
|
+
The second set
|
|
139
|
+
|
|
118
140
|
## Returns
|
|
119
141
|
|
|
120
142
|
`Set`\<`TKey`\>
|
|
121
143
|
|
|
144
|
+
A new set representing the union of `a` and `b`
|
|
145
|
+
|
|
122
146
|
|
|
123
147
|
Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
|
|
124
148
|
|
|
@@ -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.84",
|
|
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.13",
|
|
46
|
+
"@xylabs/tsconfig": "~7.4.13",
|
|
47
47
|
"typescript": "~5.9.3",
|
|
48
48
|
"vitest": "~4.0.18"
|
|
49
49
|
},
|