@xylabs/set 5.0.95 → 5.0.97
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 +81 -81
- package/package.json +6 -9
package/README.md
CHANGED
|
@@ -1,62 +1,82 @@
|
|
|
1
1
|
# @xylabs/set
|
|
2
2
|
|
|
3
|
-
[![
|
|
3
|
+
[![npm][npm-badge]][npm-link]
|
|
4
|
+
[![license][license-badge]][license-link]
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
[![npm-badge][]][npm-link]
|
|
7
|
-
[![npm-downloads-badge][]][npm-link]
|
|
8
|
-
[![jsdelivr-badge][]][jsdelivr-link]
|
|
9
|
-
[![npm-license-badge][]](LICENSE)
|
|
10
|
-
[![codacy-badge][]][codacy-link]
|
|
11
|
-
[![codeclimate-badge][]][codeclimate-link]
|
|
12
|
-
[![snyk-badge][]][snyk-link]
|
|
13
|
-
[![socket-badge][]][socket-link]
|
|
6
|
+
> Base functionality used throughout XY Labs TypeScript/JavaScript libraries
|
|
14
7
|
|
|
8
|
+
## Install
|
|
15
9
|
|
|
16
|
-
|
|
10
|
+
Using npm:
|
|
17
11
|
|
|
12
|
+
```sh
|
|
13
|
+
npm install {{name}}
|
|
14
|
+
```
|
|
18
15
|
|
|
16
|
+
Using yarn:
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
```sh
|
|
19
|
+
yarn add {{name}}
|
|
20
|
+
```
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Using pnpm:
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
```sh
|
|
25
|
+
pnpm add {{name}}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Using bun:
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
```sh
|
|
31
|
+
bun add {{name}}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## License
|
|
36
|
+
|
|
37
|
+
See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
|
|
27
38
|
|
|
28
|
-
|
|
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`. |
|
|
39
|
+
## Reference
|
|
33
40
|
|
|
34
|
-
###
|
|
41
|
+
### packages
|
|
35
42
|
|
|
36
|
-
###
|
|
43
|
+
### set
|
|
44
|
+
|
|
45
|
+
### .temp-typedoc
|
|
46
|
+
|
|
47
|
+
### functions
|
|
48
|
+
|
|
49
|
+
### <a id="difference"></a>difference
|
|
37
50
|
|
|
38
51
|
[**@xylabs/set**](#../README)
|
|
39
52
|
|
|
40
53
|
***
|
|
41
54
|
|
|
42
55
|
```ts
|
|
43
|
-
function difference<TKey>(a
|
|
56
|
+
function difference<TKey>(a, b): Set<TKey>;
|
|
44
57
|
```
|
|
45
58
|
|
|
46
59
|
Returns a new set containing elements in `a` that are not in `b`.
|
|
47
60
|
|
|
48
61
|
## Type Parameters
|
|
49
62
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
63
|
+
### TKey
|
|
64
|
+
|
|
65
|
+
`TKey`
|
|
53
66
|
|
|
54
67
|
## Parameters
|
|
55
68
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
69
|
+
### a
|
|
70
|
+
|
|
71
|
+
`Set`\<`TKey`\>
|
|
72
|
+
|
|
73
|
+
The source set
|
|
74
|
+
|
|
75
|
+
### b
|
|
76
|
+
|
|
77
|
+
`Set`\<`TKey`\>
|
|
78
|
+
|
|
79
|
+
The set of elements to exclude
|
|
60
80
|
|
|
61
81
|
## Returns
|
|
62
82
|
|
|
@@ -64,30 +84,37 @@ Returns a new set containing elements in `a` that are not in `b`.
|
|
|
64
84
|
|
|
65
85
|
A new set representing the difference of `a` and `b`
|
|
66
86
|
|
|
67
|
-
|
|
87
|
+
### <a id="intersection"></a>intersection
|
|
68
88
|
|
|
69
89
|
[**@xylabs/set**](#../README)
|
|
70
90
|
|
|
71
91
|
***
|
|
72
92
|
|
|
73
93
|
```ts
|
|
74
|
-
function intersection<TKey>(a
|
|
94
|
+
function intersection<TKey>(a, b): Set<TKey>;
|
|
75
95
|
```
|
|
76
96
|
|
|
77
97
|
Returns a new set containing only elements present in both `a` and `b`.
|
|
78
98
|
|
|
79
99
|
## Type Parameters
|
|
80
100
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
101
|
+
### TKey
|
|
102
|
+
|
|
103
|
+
`TKey`
|
|
84
104
|
|
|
85
105
|
## Parameters
|
|
86
106
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
107
|
+
### a
|
|
108
|
+
|
|
109
|
+
`Set`\<`TKey`\>
|
|
110
|
+
|
|
111
|
+
The first set
|
|
112
|
+
|
|
113
|
+
### b
|
|
114
|
+
|
|
115
|
+
`Set`\<`TKey`\>
|
|
116
|
+
|
|
117
|
+
The second set
|
|
91
118
|
|
|
92
119
|
## Returns
|
|
93
120
|
|
|
@@ -95,73 +122,46 @@ Returns a new set containing only elements present in both `a` and `b`.
|
|
|
95
122
|
|
|
96
123
|
A new set representing the intersection of `a` and `b`
|
|
97
124
|
|
|
98
|
-
|
|
125
|
+
### <a id="union"></a>union
|
|
99
126
|
|
|
100
127
|
[**@xylabs/set**](#../README)
|
|
101
128
|
|
|
102
129
|
***
|
|
103
130
|
|
|
104
131
|
```ts
|
|
105
|
-
function union<TKey>(a
|
|
132
|
+
function union<TKey>(a, b): Set<TKey>;
|
|
106
133
|
```
|
|
107
134
|
|
|
108
135
|
Returns a new set containing all elements from both `a` and `b`.
|
|
109
136
|
|
|
110
137
|
## Type Parameters
|
|
111
138
|
|
|
112
|
-
|
|
113
|
-
| ------ |
|
|
114
|
-
| `TKey` |
|
|
139
|
+
### TKey
|
|
115
140
|
|
|
116
|
-
|
|
141
|
+
`TKey`
|
|
117
142
|
|
|
118
|
-
|
|
119
|
-
| ------ | ------ | ------ |
|
|
120
|
-
| `a` | `Set`\<`TKey`\> | The first set |
|
|
121
|
-
| `b` | `Set`\<`TKey`\> | The second set |
|
|
143
|
+
## Parameters
|
|
122
144
|
|
|
123
|
-
|
|
145
|
+
### a
|
|
124
146
|
|
|
125
147
|
`Set`\<`TKey`\>
|
|
126
148
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
|
|
149
|
+
The first set
|
|
131
150
|
|
|
132
|
-
|
|
151
|
+
### b
|
|
133
152
|
|
|
134
|
-
|
|
135
|
-
- [Matt Jones](https://github.com/jonesmac)
|
|
136
|
-
- [Joel Carter](https://github.com/JoelBCarter)
|
|
137
|
-
- [Jordan Trouw](https://github.com/jordantrouw)
|
|
153
|
+
`Set`\<`TKey`\>
|
|
138
154
|
|
|
139
|
-
|
|
155
|
+
The second set
|
|
140
156
|
|
|
141
|
-
|
|
157
|
+
## Returns
|
|
142
158
|
|
|
143
|
-
|
|
159
|
+
`Set`\<`TKey`\>
|
|
144
160
|
|
|
145
|
-
|
|
161
|
+
A new set representing the union of `a` and `b`
|
|
146
162
|
|
|
147
|
-
[logo]: https://cdn.xy.company/img/brand/XYPersistentCompany_Logo_Icon_Colored.svg
|
|
148
163
|
|
|
149
|
-
[main-build]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml/badge.svg
|
|
150
|
-
[main-build-link]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml
|
|
151
164
|
[npm-badge]: https://img.shields.io/npm/v/@xylabs/set.svg
|
|
152
165
|
[npm-link]: https://www.npmjs.com/package/@xylabs/set
|
|
153
|
-
[
|
|
154
|
-
[
|
|
155
|
-
[codeclimate-badge]: https://api.codeclimate.com/v1/badges/c5eb068f806f0b047ea7/maintainability
|
|
156
|
-
[codeclimate-link]: https://codeclimate.com/github/xylabs/sdk-js/maintainability
|
|
157
|
-
[snyk-badge]: https://snyk.io/test/github/xylabs/sdk-js/badge.svg?targetFile=package.json
|
|
158
|
-
[snyk-link]: https://snyk.io/test/github/xylabs/sdk-js?targetFile=package.json
|
|
159
|
-
|
|
160
|
-
[npm-downloads-badge]: https://img.shields.io/npm/dw/@xylabs/set
|
|
161
|
-
[npm-license-badge]: https://img.shields.io/npm/l/@xylabs/set
|
|
162
|
-
|
|
163
|
-
[jsdelivr-badge]: https://data.jsdelivr.com/v1/package/npm/@xylabs/set/badge
|
|
164
|
-
[jsdelivr-link]: https://www.jsdelivr.com/package/npm/@xylabs/set
|
|
165
|
-
|
|
166
|
-
[socket-badge]: https://socket.dev/api/badge/npm/package/@xylabs/set
|
|
167
|
-
[socket-link]: https://socket.dev/npm/package/@xylabs/set
|
|
166
|
+
[license-badge]: https://img.shields.io/npm/l/@xylabs/set.svg
|
|
167
|
+
[license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/set",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.97",
|
|
4
4
|
"description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"set",
|
|
@@ -29,12 +29,10 @@
|
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
31
31
|
"types": "./dist/neutral/index.d.ts",
|
|
32
|
-
"import": "./dist/neutral/index.mjs",
|
|
33
32
|
"default": "./dist/neutral/index.mjs"
|
|
34
33
|
},
|
|
35
34
|
"./package.json": "./package.json"
|
|
36
35
|
},
|
|
37
|
-
"types": "./dist/neutral/index.d.ts",
|
|
38
36
|
"files": [
|
|
39
37
|
"dist",
|
|
40
38
|
"!**/*.bench.*",
|
|
@@ -43,14 +41,13 @@
|
|
|
43
41
|
"README.md"
|
|
44
42
|
],
|
|
45
43
|
"devDependencies": {
|
|
46
|
-
"@types/node": "^25.
|
|
47
|
-
"@xylabs/
|
|
48
|
-
"@xylabs/
|
|
49
|
-
"@xylabs/tsconfig": "~7.8.4",
|
|
44
|
+
"@types/node": "^25.6.0",
|
|
45
|
+
"@xylabs/toolchain": "~7.10.4",
|
|
46
|
+
"@xylabs/tsconfig": "~7.10.4",
|
|
50
47
|
"esbuild": "^0.28.0",
|
|
51
48
|
"typescript": "^5",
|
|
52
|
-
"vite": "^8.0.
|
|
53
|
-
"vitest": "^4.1.
|
|
49
|
+
"vite": "^8.0.8",
|
|
50
|
+
"vitest": "^4.1.4"
|
|
54
51
|
},
|
|
55
52
|
"engines": {
|
|
56
53
|
"node": ">=18"
|