@stryke/unique-id 0.3.19 → 0.3.27
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/CHANGELOG.md +283 -0
- package/README.md +18 -10
- package/dist/cuid-BuvbHUZ8.cjs +1 -0
- package/dist/cuid-CcPQdiR_.mjs +2 -0
- package/dist/cuid-CcPQdiR_.mjs.map +1 -0
- package/dist/cuid-DT9rtBzf.d.mts +20 -0
- package/dist/cuid-DT9rtBzf.d.mts.map +1 -0
- package/dist/cuid-gUcp5l6X.d.cts +20 -0
- package/dist/cuid-gUcp5l6X.d.cts.map +1 -0
- package/dist/cuid.cjs +1 -30
- package/dist/cuid.d.cts +2 -0
- package/dist/cuid.d.mts +2 -0
- package/dist/cuid.mjs +1 -1
- package/dist/index.cjs +1 -60
- package/dist/index.d.cts +6 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +1 -1
- package/dist/nanoid-client-DxgQ8Vt2.cjs +1 -0
- package/dist/nanoid-client-bEHxSBYB.mjs +2 -0
- package/dist/nanoid-client-bEHxSBYB.mjs.map +1 -0
- package/dist/{nanoid-client.d.ts → nanoid-client-mNAgNxsW.d.cts} +5 -1
- package/dist/nanoid-client-mNAgNxsW.d.cts.map +1 -0
- package/dist/nanoid-client-nC1JFvZD.d.mts +11 -0
- package/dist/nanoid-client-nC1JFvZD.d.mts.map +1 -0
- package/dist/nanoid-client.cjs +1 -10
- package/dist/nanoid-client.d.cts +2 -0
- package/dist/nanoid-client.d.mts +2 -0
- package/dist/nanoid-client.mjs +1 -1
- package/dist/{random.d.ts → random-Bd2-oY2n.d.cts} +8 -4
- package/dist/random-Bd2-oY2n.d.cts.map +1 -0
- package/dist/random-C4CrqJsp.cjs +1 -0
- package/dist/random-DTxCCJYh.d.mts +33 -0
- package/dist/random-DTxCCJYh.d.mts.map +1 -0
- package/dist/random-kTN0s0Jy.mjs +2 -0
- package/dist/random-kTN0s0Jy.mjs.map +1 -0
- package/dist/random.cjs +1 -28
- package/dist/random.d.cts +2 -0
- package/dist/random.d.mts +2 -0
- package/dist/random.mjs +1 -1
- package/dist/snowflake-B6ivA7bE.d.mts +102 -0
- package/dist/snowflake-B6ivA7bE.d.mts.map +1 -0
- package/dist/snowflake-BtoDXB99.mjs +2 -0
- package/dist/snowflake-BtoDXB99.mjs.map +1 -0
- package/dist/snowflake-CLDXd54w.cjs +1 -0
- package/dist/snowflake-DQmoRlnq.d.cts +102 -0
- package/dist/snowflake-DQmoRlnq.d.cts.map +1 -0
- package/dist/snowflake.cjs +1 -47
- package/dist/snowflake.d.cts +2 -0
- package/dist/snowflake.d.mts +2 -0
- package/dist/snowflake.mjs +1 -1
- package/dist/uuid-BnD3hGTH.cjs +1 -0
- package/dist/{uuid.d.ts → uuid-ByPTbUGJ.d.mts} +5 -1
- package/dist/uuid-ByPTbUGJ.d.mts.map +1 -0
- package/dist/uuid-DCE9JeUQ.d.cts +22 -0
- package/dist/uuid-DCE9JeUQ.d.cts.map +1 -0
- package/dist/uuid-DSMliG_W.mjs +2 -0
- package/dist/uuid-DSMliG_W.mjs.map +1 -0
- package/dist/uuid.cjs +1 -23
- package/dist/uuid.d.cts +2 -0
- package/dist/uuid.d.mts +2 -0
- package/dist/uuid.mjs +1 -1
- package/package.json +19 -115
- package/dist/cuid.d.ts +0 -16
- package/dist/index.d.ts +0 -13
- package/dist/snowflake.d.ts +0 -98
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# Changelog for Stryke - Unique ID
|
|
4
|
+
|
|
5
|
+
## [0.3.26](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.26) (12/07/2025)
|
|
6
|
+
|
|
7
|
+
### Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated **hash** to **v0.12.21**
|
|
10
|
+
|
|
11
|
+
## [0.3.25](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.25) (12/07/2025)
|
|
12
|
+
|
|
13
|
+
### Miscellaneous
|
|
14
|
+
|
|
15
|
+
- **monorepo:** Format monorepo source files
|
|
16
|
+
([9428936](https://github.com/storm-software/stryke/commit/9428936))
|
|
17
|
+
|
|
18
|
+
### Updated Dependencies
|
|
19
|
+
|
|
20
|
+
- Updated **hash** to **v0.12.20**
|
|
21
|
+
|
|
22
|
+
## [0.3.24](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.24) (12/06/2025)
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
- **tools-nx:** Resolved issue inferring build command-line arguments for local
|
|
27
|
+
packages ([de00278](https://github.com/storm-software/stryke/commit/de00278))
|
|
28
|
+
|
|
29
|
+
### Updated Dependencies
|
|
30
|
+
|
|
31
|
+
- Updated **hash** to **v0.12.19**
|
|
32
|
+
|
|
33
|
+
## [0.3.23](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.23) (12/06/2025)
|
|
34
|
+
|
|
35
|
+
### Updated Dependencies
|
|
36
|
+
|
|
37
|
+
- Updated **hash** to **v0.12.18**
|
|
38
|
+
|
|
39
|
+
## [0.3.22](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.22) (12/05/2025)
|
|
40
|
+
|
|
41
|
+
### Updated Dependencies
|
|
42
|
+
|
|
43
|
+
- Updated **hash** to **v0.12.17**
|
|
44
|
+
|
|
45
|
+
## [0.3.21](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.21) (12/05/2025)
|
|
46
|
+
|
|
47
|
+
### Features
|
|
48
|
+
|
|
49
|
+
- **monorepo:** Update repository to use `tsdown` to build/bundle packages
|
|
50
|
+
([8ceb909](https://github.com/storm-software/stryke/commit/8ceb909))
|
|
51
|
+
|
|
52
|
+
### Updated Dependencies
|
|
53
|
+
|
|
54
|
+
- Updated **hash** to **v0.12.16**
|
|
55
|
+
|
|
56
|
+
## [0.3.20](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.20) (12/01/2025)
|
|
57
|
+
|
|
58
|
+
### Updated Dependencies
|
|
59
|
+
|
|
60
|
+
- Updated **hash** to **v0.12.15**
|
|
61
|
+
|
|
62
|
+
## [0.3.19](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.19) (11/30/2025)
|
|
63
|
+
|
|
64
|
+
### Updated Dependencies
|
|
65
|
+
|
|
66
|
+
- Updated **hash** to **v0.12.14**
|
|
67
|
+
|
|
68
|
+
## [0.3.18](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.18) (11/30/2025)
|
|
69
|
+
|
|
70
|
+
### Updated Dependencies
|
|
71
|
+
|
|
72
|
+
- Updated **hash** to **v0.12.13**
|
|
73
|
+
|
|
74
|
+
## [0.3.17](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.17) (11/30/2025)
|
|
75
|
+
|
|
76
|
+
### Updated Dependencies
|
|
77
|
+
|
|
78
|
+
- Updated **hash** to **v0.12.12**
|
|
79
|
+
|
|
80
|
+
## [0.3.16](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.16) (11/30/2025)
|
|
81
|
+
|
|
82
|
+
### Updated Dependencies
|
|
83
|
+
|
|
84
|
+
- Updated **hash** to **v0.12.11**
|
|
85
|
+
|
|
86
|
+
## [0.3.15](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.15) (11/24/2025)
|
|
87
|
+
|
|
88
|
+
### Updated Dependencies
|
|
89
|
+
|
|
90
|
+
- Updated **hash** to **v0.12.10**
|
|
91
|
+
|
|
92
|
+
## [0.3.14](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.14) (11/21/2025)
|
|
93
|
+
|
|
94
|
+
### Updated Dependencies
|
|
95
|
+
|
|
96
|
+
- Updated **hash** to **v0.12.9**
|
|
97
|
+
|
|
98
|
+
## [0.3.13](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.13) (11/21/2025)
|
|
99
|
+
|
|
100
|
+
### Updated Dependencies
|
|
101
|
+
|
|
102
|
+
- Updated **hash** to **v0.12.8**
|
|
103
|
+
|
|
104
|
+
## [0.3.12](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.12) (11/21/2025)
|
|
105
|
+
|
|
106
|
+
### Updated Dependencies
|
|
107
|
+
|
|
108
|
+
- Updated **hash** to **v0.12.7**
|
|
109
|
+
|
|
110
|
+
## [0.3.11](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.11) (11/21/2025)
|
|
111
|
+
|
|
112
|
+
### Updated Dependencies
|
|
113
|
+
|
|
114
|
+
- Updated **hash** to **v0.12.6**
|
|
115
|
+
|
|
116
|
+
## [0.3.10](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.10) (11/21/2025)
|
|
117
|
+
|
|
118
|
+
### Updated Dependencies
|
|
119
|
+
|
|
120
|
+
- Updated **hash** to **v0.12.5**
|
|
121
|
+
|
|
122
|
+
## [0.3.9](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.9) (11/21/2025)
|
|
123
|
+
|
|
124
|
+
### Updated Dependencies
|
|
125
|
+
|
|
126
|
+
- Updated **hash** to **v0.12.4**
|
|
127
|
+
|
|
128
|
+
## [0.3.8](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.8) (11/16/2025)
|
|
129
|
+
|
|
130
|
+
### Updated Dependencies
|
|
131
|
+
|
|
132
|
+
- Updated **hash** to **v0.12.3**
|
|
133
|
+
|
|
134
|
+
## [0.3.7](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.7) (11/16/2025)
|
|
135
|
+
|
|
136
|
+
### Updated Dependencies
|
|
137
|
+
|
|
138
|
+
- Updated **hash** to **v0.12.2**
|
|
139
|
+
|
|
140
|
+
## [0.3.6](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.6) (11/08/2025)
|
|
141
|
+
|
|
142
|
+
### Updated Dependencies
|
|
143
|
+
|
|
144
|
+
- Updated **hash** to **v0.12.1**
|
|
145
|
+
|
|
146
|
+
## [0.3.5](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.5) (2025-09-19)
|
|
147
|
+
|
|
148
|
+
### Bug Fixes
|
|
149
|
+
|
|
150
|
+
- **unique-id:** Resolve issue with invalid import
|
|
151
|
+
([21ec0c1](https://github.com/storm-software/stryke/commit/21ec0c1))
|
|
152
|
+
|
|
153
|
+
## [0.3.4](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.4) (2025-08-08)
|
|
154
|
+
|
|
155
|
+
### Bug Fixes
|
|
156
|
+
|
|
157
|
+
- **string-format:** Resolved issues with aronym string formatting
|
|
158
|
+
([49f67d4](https://github.com/storm-software/stryke/commit/49f67d4))
|
|
159
|
+
|
|
160
|
+

|
|
161
|
+
|
|
162
|
+
# Changelog for Stryke - Unique ID
|
|
163
|
+
|
|
164
|
+
## [0.3.3](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.3) (2025-07-01)
|
|
165
|
+
|
|
166
|
+
### Miscellaneous
|
|
167
|
+
|
|
168
|
+
- **unique-id:** Format package source files and resolve lint rule violations
|
|
169
|
+
([7deb66c](https://github.com/storm-software/stryke/commit/7deb66c))
|
|
170
|
+
|
|
171
|
+

|
|
172
|
+
|
|
173
|
+
# Changelog for Stryke - Unique Id
|
|
174
|
+
|
|
175
|
+
## [0.3.2](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.2) (2025-06-17)
|
|
176
|
+
|
|
177
|
+
### Miscellaneous
|
|
178
|
+
|
|
179
|
+
- **unique-id:** Format file banners
|
|
180
|
+
- **monorepo:** Reformat repository packages
|
|
181
|
+
|
|
182
|
+
## [0.3.1](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.1) (2025-06-12)
|
|
183
|
+
|
|
184
|
+
### Miscellaneous
|
|
185
|
+
|
|
186
|
+
- **monorepo:** Reformat the repository's README markdown files
|
|
187
|
+
- **monorepo:** Run format script on repository
|
|
188
|
+
|
|
189
|
+
## [0.3.0](https://github.com/storm-software/stryke/releases/tag/unique-id%400.3.0) (2025-05-29)
|
|
190
|
+
|
|
191
|
+
### Features
|
|
192
|
+
|
|
193
|
+
- **fs:** Added the command exists helper modules
|
|
194
|
+
|
|
195
|
+
## [0.2.7](https://github.com/storm-software/stryke/releases/tag/unique-id%400.2.7) (2025-05-12)
|
|
196
|
+
|
|
197
|
+
### Miscellaneous
|
|
198
|
+
|
|
199
|
+
- **monorepo:** Reformat monorepo source code
|
|
200
|
+
|
|
201
|
+
## [0.2.6](https://github.com/storm-software/stryke/releases/tag/unique-id%400.2.6) (2025-04-25)
|
|
202
|
+
|
|
203
|
+
### Miscellaneous
|
|
204
|
+
|
|
205
|
+
- **unique-id:** Format source files
|
|
206
|
+
([6c1d0d4](https://github.com/storm-software/stryke/commit/6c1d0d4))
|
|
207
|
+
|
|
208
|
+
## [0.2.5](https://github.com/storm-software/stryke/releases/tag/unique-id%400.2.5) (2025-03-28)
|
|
209
|
+
|
|
210
|
+
### Miscellaneous
|
|
211
|
+
|
|
212
|
+
- **monorepo:** Reformat the source files in repository
|
|
213
|
+
([bb8df2c](https://github.com/storm-software/stryke/commit/bb8df2c))
|
|
214
|
+
|
|
215
|
+
## [0.2.4](https://github.com/storm-software/stryke/releases/tag/unique-id%400.2.4) (2025-03-23)
|
|
216
|
+
|
|
217
|
+
### Bug Fixes
|
|
218
|
+
|
|
219
|
+
- **monorepo:** Resolve issue with TypeScript compilation
|
|
220
|
+
([72e995f](https://github.com/storm-software/stryke/commit/72e995f))
|
|
221
|
+
|
|
222
|
+
## [0.2.3](https://github.com/storm-software/stryke/releases/tag/unique-id%400.2.3) (2025-03-23)
|
|
223
|
+
|
|
224
|
+
### Miscellaneous
|
|
225
|
+
|
|
226
|
+
- **monorepo:** Update base storm software packages
|
|
227
|
+
([8942201](https://github.com/storm-software/stryke/commit/8942201))
|
|
228
|
+
|
|
229
|
+
## 0.2.2 (2025-03-13)
|
|
230
|
+
|
|
231
|
+
### Miscellaneous
|
|
232
|
+
|
|
233
|
+
- **monorepo:** Format monorepo project files
|
|
234
|
+
([f28fdbe](https://github.com/storm-software/stryke/commit/f28fdbe))
|
|
235
|
+
|
|
236
|
+
## 0.2.1 (2025-02-26)
|
|
237
|
+
|
|
238
|
+
### Miscellaneous
|
|
239
|
+
|
|
240
|
+
- **monorepo:** Reformat monorepo files with `prettier`
|
|
241
|
+
([b5d0302](https://github.com/storm-software/stryke/commit/b5d0302))
|
|
242
|
+
|
|
243
|
+
## 0.2.0 (2025-02-23)
|
|
244
|
+
|
|
245
|
+
### Features
|
|
246
|
+
|
|
247
|
+
- **monorepo:** Update base ESLint packages and run on files
|
|
248
|
+
([c59cb8e](https://github.com/storm-software/stryke/commit/c59cb8e))
|
|
249
|
+
|
|
250
|
+
## 0.1.4 (2025-02-17)
|
|
251
|
+
|
|
252
|
+
### Miscellaneous
|
|
253
|
+
|
|
254
|
+
- **monorepo:** Reformat monorepo files
|
|
255
|
+
([1db5e06](https://github.com/storm-software/stryke/commit/1db5e06))
|
|
256
|
+
|
|
257
|
+
## 0.1.3 (2025-02-15)
|
|
258
|
+
|
|
259
|
+
### Miscellaneous
|
|
260
|
+
|
|
261
|
+
- **monorepo:** Reformat monorepo files
|
|
262
|
+
([69ed6b7](https://github.com/storm-software/stryke/commit/69ed6b7))
|
|
263
|
+
|
|
264
|
+
## 0.1.2 (2025-02-15)
|
|
265
|
+
|
|
266
|
+
### Miscellaneous
|
|
267
|
+
|
|
268
|
+
- **monorepo:** Reformat workspace files
|
|
269
|
+
([ad2d6a9](https://github.com/storm-software/stryke/commit/ad2d6a9))
|
|
270
|
+
|
|
271
|
+
## 0.1.1 (2025-02-09)
|
|
272
|
+
|
|
273
|
+
### Miscellaneous
|
|
274
|
+
|
|
275
|
+
- **monorepo:** Regenerate repository markdown files
|
|
276
|
+
([e61e39e](https://github.com/storm-software/stryke/commit/e61e39e))
|
|
277
|
+
|
|
278
|
+
## 0.1.0 (2025-02-07)
|
|
279
|
+
|
|
280
|
+
### Bug Fixes
|
|
281
|
+
|
|
282
|
+
- **cli:** Resolve typing issue with `figlet` dependency
|
|
283
|
+
([2ad7747](https://github.com/storm-software/stryke/commit/2ad7747))
|
package/README.md
CHANGED
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
<!-- markdownlint-disable -->
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
<div align="center"
|
|
6
|
+
<div align="center">
|
|
7
|
+
<picture>
|
|
8
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/storm-software/banner-1280x640-dark-optimized.gif">
|
|
9
|
+
<source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/storm-software/banner-1280x640-light-optimized.gif">
|
|
10
|
+
<img src="https://public.storm-cdn.com/storm-software/banner-1280x640-dark-optimized.gif" width="100%" alt="Storm Software" />
|
|
11
|
+
</picture>
|
|
12
|
+
</div>
|
|
7
13
|
<br />
|
|
8
14
|
|
|
9
15
|
<div align="center">
|
|
@@ -16,13 +22,13 @@
|
|
|
16
22
|
</div>
|
|
17
23
|
|
|
18
24
|
<br />
|
|
19
|
-
This package is part of Storm Software's
|
|
25
|
+
This package is part of Storm Software's **💥 Stryke** monorepo. Stryke packages TypeScript utility packages with shared functionality common to many Storm Software applications.
|
|
20
26
|
|
|
21
27
|
<br />
|
|
22
28
|
|
|
23
29
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
24
30
|
|
|
25
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
26
32
|
|
|
27
33
|
> [!IMPORTANT] Important
|
|
28
34
|
> This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be available through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.
|
|
@@ -57,7 +63,6 @@ This package includes generator functions for the following type of identifiers:
|
|
|
57
63
|
|
|
58
64
|
<!-- START doctoc -->
|
|
59
65
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
60
|
-
|
|
61
66
|
## Table of Contents
|
|
62
67
|
|
|
63
68
|
- [Installing](#installing)
|
|
@@ -104,10 +109,10 @@ yarn add -D @stryke/unique-id
|
|
|
104
109
|
|
|
105
110
|
## Reduced Package Size
|
|
106
111
|
|
|
107
|
-
This project uses [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
112
|
+
This project uses [tsdown](https://tsdown.dev) to package the source code due to
|
|
113
|
+
its ability to remove unused code and ship smaller javascript files thanks to
|
|
114
|
+
code splitting. This helps to greatly reduce the size of the package and to make
|
|
115
|
+
it easier to use in other projects.
|
|
111
116
|
|
|
112
117
|
## Development
|
|
113
118
|
|
|
@@ -248,10 +253,13 @@ specification. Contributions of any kind welcome!
|
|
|
248
253
|
<br />
|
|
249
254
|
|
|
250
255
|
<hr />
|
|
251
|
-
<br />
|
|
252
256
|
|
|
253
257
|
<div align="center">
|
|
254
|
-
<
|
|
258
|
+
<picture>
|
|
259
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/storm-software/banner-1280x320-dark-optimized.webp">
|
|
260
|
+
<source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/storm-software/banner-1280x320-light-optimized.webp">
|
|
261
|
+
<img src="https://public.storm-cdn.com/storm-software/banner-1280x320-dark-optimized.webp" width="100%" alt="Storm Software" />
|
|
262
|
+
</picture>
|
|
255
263
|
</div>
|
|
256
264
|
<br />
|
|
257
265
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require(`./random-C4CrqJsp.cjs`);require(`defu`),require(`glob`);let l=require(`ohash`);require(`js-xxhash`);const u=typeof Buffer<`u`,d=u?Buffer.isBuffer.bind(Buffer):function(e){return!1},f=(e=>(typeof globalThis==`object`||Object.defineProperty(e,`typeDetectGlobalObject`,{get(){return this},configurable:!0}),globalThis))(Object.prototype),p=new TextEncoder,m=new TextDecoder;function h(e,t){let n=(0,l.hash)(e),r=t?.maxLength??32;return n.length>r?n.slice(0,r):n}const g=476782367,_=36,v=Math.floor(Math.random()*476782367)+1;function y(e=4,t=Math.random){let n=``;for(;n.length<e;)n+=Math.floor(t()*36).toString(36);return n}function b(e){let t=(e?.globalObj??typeof globalThis>`u`)&&typeof globalThis>`u`?{}:globalThis,n=Object.keys(t).toString();return h(n.length>0?n+y(36,Math.random):y(36,Math.random)).slice(0,36)}function x(){let e=Date.now().toString(36),t=v.toString(36),n=h(`${e+y(36,Math.random)+t+b()}`);return`${c.i()+n.slice(1,Math.min(n.length-1,36))}`}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return x}});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./random-kTN0s0Jy.mjs";import"defu";import"glob";import{hash as t}from"ohash";import"js-xxhash";typeof Buffer<`u`&&Buffer.isBuffer.bind(Buffer),(e=>(typeof globalThis==`object`||Object.defineProperty(e,`typeDetectGlobalObject`,{get(){return this},configurable:!0}),globalThis))(Object.prototype),new TextEncoder,new TextDecoder;function n(e,n){let r=t(e),i=n?.maxLength??32;return r.length>i?r.slice(0,i):r}const r=Math.floor(Math.random()*476782367)+1;function i(e=4,t=Math.random){let n=``;for(;n.length<e;)n+=Math.floor(t()*36).toString(36);return n}function a(e){let t=(e?.globalObj??typeof globalThis>`u`)&&typeof globalThis>`u`?{}:globalThis,r=Object.keys(t).toString();return n(r.length>0?r+i(36,Math.random):i(36,Math.random)).slice(0,36)}function o(){let t=Date.now().toString(36),o=r.toString(36),s=n(`${t+i(36,Math.random)+o+a()}`);return`${e()+s.slice(1,Math.min(s.length-1,36))}`}export{o as t};
|
|
2
|
+
//# sourceMappingURL=cuid-CcPQdiR_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cuid-CcPQdiR_.mjs","names":["isBuffer: typeof Buffer.isBuffer","isBuffer","ohash"],"sources":["../../type-checks/src/is-buffer.ts","../../type-checks/src/type-detect.ts","../../convert/src/string-to-utf8-array.ts","../../convert/src/utf8-array-to-string.ts","../../hash/src/murmurhash.ts","../src/cuid.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isBufferExists = typeof Buffer !== \"undefined\";\n\n/**\n * Check if the provided value's type is `Buffer`\n */\nexport const isBuffer: typeof Buffer.isBuffer = isBufferExists\n ? Buffer.isBuffer.bind(Buffer)\n : /**\n * Check if the provided value's type is `Buffer`\n\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Buffer`\n */\n function isBuffer(\n value: Parameters<typeof Buffer.isBuffer>[0]\n ): value is Buffer {\n return false;\n };\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isBuffer } from \"./is-buffer\";\n\nconst globalObject = (Obj => {\n if (typeof globalThis === \"object\") {\n return globalThis;\n }\n Object.defineProperty(Obj, \"typeDetectGlobalObject\", {\n get() {\n return this;\n },\n configurable: true\n });\n\n // // biome-ignore lint/correctness/noUndeclaredVariables: <explanation>\n // const global = typeDetectGlobalObject;\n\n // // biome-ignore lint/performance/noDelete: <explanation>\n // delete Obj.typeDetectGlobalObject;\n return globalThis;\n})(Object.prototype);\n\nexport function typeDetect(obj: unknown): string {\n // NOTE: isBuffer must execute before type-detect,\n // because type-detect returns 'Uint8Array'.\n if (isBuffer(obj)) {\n return \"Buffer\";\n }\n\n const typeofObj = typeof obj;\n if (typeofObj !== \"object\") {\n return typeofObj;\n }\n\n if (obj === null) {\n return \"null\";\n }\n\n if (obj === globalObject) {\n return \"global\";\n }\n\n if (\n Array.isArray(obj) &&\n (Symbol.toStringTag === undefined || !(Symbol.toStringTag in obj))\n ) {\n return \"Array\";\n }\n\n // https://html.spec.whatwg.org/multipage/browsers.html#location\n if (typeof globalThis === \"object\" && globalThis !== null) {\n if (\n typeof (globalThis as any).location === \"object\" &&\n obj === (globalThis as any).location\n ) {\n return \"Location\";\n }\n\n // https://html.spec.whatwg.org/#document\n if (\n typeof (globalThis as any).document === \"object\" &&\n obj === (globalThis as any).document\n ) {\n return \"Document\";\n }\n\n // https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray\n if (typeof (globalThis as any).navigator === \"object\") {\n if (\n typeof (globalThis as any).navigator.mimeTypes === \"object\" &&\n obj === (globalThis as any).navigator.mimeTypes\n ) {\n return \"MimeTypeArray\";\n }\n\n // https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray\n if (\n typeof (globalThis as any).navigator.plugins === \"object\" &&\n obj === (globalThis as any).navigator.plugins\n ) {\n return \"PluginArray\";\n }\n }\n\n // https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray\n if (\n (typeof (globalThis as any).HTMLElement === \"function\" ||\n typeof (globalThis as any).HTMLElement === \"object\") &&\n obj instanceof (globalThis as any).HTMLElement\n ) {\n if ((obj as any).tagName === \"BLOCKQUOTE\") {\n return \"HTMLQuoteElement\";\n }\n\n // https://html.spec.whatwg.org/#htmltabledatacellelement\n if ((obj as any).tagName === \"TD\") {\n return \"HTMLTableDataCellElement\";\n }\n\n // https://html.spec.whatwg.org/#htmltableheadercellelement\n if ((obj as any).tagName === \"TH\") {\n return \"HTMLTableHeaderCellElement\";\n }\n }\n }\n\n const stringTag =\n Symbol.toStringTag !== undefined && (obj as any)[Symbol.toStringTag];\n if (typeof stringTag === \"string\") {\n return stringTag;\n }\n\n const objPrototype = Object.getPrototypeOf(obj);\n if (objPrototype === RegExp.prototype) {\n return \"RegExp\";\n }\n\n if (objPrototype === Date.prototype) {\n return \"Date\";\n }\n\n // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag\n if (typeof Promise !== \"undefined\" && objPrototype === Promise.prototype) {\n return \"Promise\";\n }\n\n if (typeof Set !== \"undefined\" && objPrototype === Set.prototype) {\n return \"Set\";\n }\n\n if (typeof Map !== \"undefined\" && objPrototype === Map.prototype) {\n return \"Map\";\n }\n\n if (typeof WeakSet !== \"undefined\" && objPrototype === WeakSet.prototype) {\n return \"WeakSet\";\n }\n\n if (typeof WeakMap !== \"undefined\" && objPrototype === WeakMap.prototype) {\n return \"WeakMap\";\n }\n\n // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag\n if (typeof DataView !== \"undefined\" && objPrototype === DataView.prototype) {\n return \"DataView\";\n }\n\n // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag\n if (\n typeof Map !== \"undefined\" &&\n objPrototype === Object.getPrototypeOf(new Map().entries())\n ) {\n return \"Map Iterator\";\n }\n\n // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag\n if (\n typeof Set !== \"undefined\" &&\n objPrototype === Object.getPrototypeOf(new Set().entries())\n ) {\n return \"Set Iterator\";\n }\n\n // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag\n if (\n typeof Array.prototype[Symbol.iterator] === \"function\" &&\n objPrototype === Object.getPrototypeOf([][Symbol.iterator]())\n ) {\n return \"Array Iterator\";\n }\n\n // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag\n if (\n Symbol.iterator !== undefined &&\n typeof String.prototype[Symbol.iterator] === \"function\" &&\n Object.getPrototypeOf(\"\"[Symbol.iterator]()) &&\n objPrototype === Object.getPrototypeOf(\"\"[Symbol.iterator]())\n ) {\n return \"String Iterator\";\n }\n\n if (objPrototype === null) {\n return \"Object\";\n }\n\n return Object.prototype.toString.call(obj).slice(8, -1);\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nconst encoder = new TextEncoder();\n\n/**\n * Convert a string to a utf-8 array\n *\n * @param input - The string to convert\n * @returns The converted utf-8 array\n */\nexport function stringToUtf8Array(input: string): Uint8Array {\n return encoder.encode(input);\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nconst decoder = new TextDecoder();\n\n/**\n * Convert a utf-8 array to string\n *\n * @param input - Utf-8 Array\n * @returns The converted string\n */\nexport function utf8ArrayToString(\n input: NodeJS.ArrayBufferView | ArrayBuffer\n): string {\n return decoder.decode(input);\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { hash as ohash } from \"ohash\";\n\nexport interface HashOptions {\n /**\n * The maximum length of the hash\n *\n * @defaultValue 32\n */\n maxLength?: number;\n}\n\n/**\n * Use a [MurmurHash3](https://en.wikipedia.org/wiki/MurmurHash) based algorithm to hash any JS value into a string.\n *\n * @see https://github.com/ohash/ohash\n * @see https://en.wikipedia.org/wiki/MurmurHash\n *\n * @param content - The value to hash\n * @param options - Hashing options\n * @returns A hashed string value\n */\nexport function murmurhash(content: any, options?: HashOptions): string {\n const result = ohash(content);\n const maxLength = options?.maxLength ?? 32;\n\n return result.length > maxLength ? result.slice(0, maxLength) : result;\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { murmurhash } from \"@stryke/hash/neutral\";\nimport { randomLetter } from \"./random\";\n\n/**\n * ~22k hosts before 50% chance of initial counter collision with a remaining counter range of 9.0e+15 in JavaScript.\n */\nconst INITIAL_COUNT_MAX = 476_782_367;\n\n/**\n * The length of the CUID fingerprint.\n */\nconst CUID_LARGE_LENGTH = 36;\n\n/**\n * The sequence of the current running generator.\n *\n * @defaultValue 1\n */\nconst sequence = 1;\n\n/**\n * The counter used to help prevent collisions.\n */\nconst counter = Math.floor(Math.random() * INITIAL_COUNT_MAX) + sequence;\n\n/**\n * Generate a random letter\n *\n * @param length - The length of the random string to generate\n * @param random - The random number generator\n * @returns A random letter\n */\nfunction createEntropy(length = 4, random = Math.random) {\n let entropy = \"\";\n\n while (entropy.length < length) {\n entropy += Math.floor(random() * CUID_LARGE_LENGTH).toString(\n CUID_LARGE_LENGTH\n );\n }\n return entropy;\n}\n\nexport interface FingerprintOptions {\n globalObj?: any;\n}\n\n/**\n * This is a fingerprint of the host environment. It is used to help prevent collisions when generating ids in a distributed system.\n *\n * @remarks\n * If no global object is available, you can pass in your own, or fall back on a random string.\n *\n * @param options - Options\n * @returns The environment's Fingerprint\n */\nfunction fingerprint(options?: FingerprintOptions): string {\n const globalObj =\n (options?.globalObj ?? typeof globalThis === \"undefined\")\n ? typeof globalThis === \"undefined\"\n ? {}\n : globalThis\n : globalThis;\n\n const globals = Object.keys(globalObj).toString();\n const sourceString =\n globals.length > 0\n ? globals + createEntropy(CUID_LARGE_LENGTH, Math.random)\n : createEntropy(CUID_LARGE_LENGTH, Math.random);\n\n return murmurhash(sourceString).slice(0, Math.max(0, CUID_LARGE_LENGTH));\n}\n\n/**\n * Generate a random CUID\n *\n * @example\n * ```typescript\n *\n * // Generate a random CUID\n * const id = cuid();\n * ```\n *\n * @returns A random CUID string\n */\nexport function cuid(): string {\n // If we're lucky, the `.toString(36)` calls may reduce hashing rounds\n // by shortening the input to the hash function a little.\n const time = Date.now().toString(CUID_LARGE_LENGTH);\n const count = counter.toString(CUID_LARGE_LENGTH);\n\n // The salt should be long enough to be globally unique across the full\n // length of the hash. For simplicity, we use the same length as the\n // intended id output.\n const salt = createEntropy(CUID_LARGE_LENGTH, Math.random);\n\n const hashed = murmurhash(`${time + salt + count + fingerprint()}`);\n\n return `${\n randomLetter() +\n hashed.slice(1, Math.min(hashed.length - 1, CUID_LARGE_LENGTH))\n }`;\n}\n"],"mappings":"mHAkB8B,OAAO,OAAW,KAM5C,OAAO,SAAS,KAAK,OAAO,ECJV,IAChB,OAAO,YAAe,UAG1B,OAAO,eAAe,EAAK,yBAA0B,CACnD,KAAM,CACJ,OAAO,MAET,aAAc,GACf,CAAC,CAPO,aAeR,OAAO,UAAU,CCnBJ,IAAI,YCAJ,IAAI,YCqBpB,SAAgB,EAAW,EAAc,EAA+B,CACtE,IAAM,EAASE,EAAM,EAAQ,CACvB,EAAY,GAAS,WAAa,GAExC,OAAO,EAAO,OAAS,EAAY,EAAO,MAAM,EAAG,EAAU,CAAG,ECnBlE,MAiBM,EAAU,KAAK,MAAM,KAAK,QAAQ,CAAG,UAAkB,CAL5C,EAcjB,SAAS,EAAc,EAAS,EAAG,EAAS,KAAK,OAAQ,CACvD,IAAI,EAAU,GAEd,KAAO,EAAQ,OAAS,GACtB,GAAW,KAAK,MAAM,GAAQ,CAAG,GAAkB,CAAC,SAClD,GACD,CAEH,OAAO,EAgBT,SAAS,EAAY,EAAsC,CACzD,IAAM,GACH,GAAS,WAAa,OAAO,WAAe,MACzC,OAAO,WAAe,IACpB,EAAE,CACF,WAGF,EAAU,OAAO,KAAK,EAAU,CAAC,UAAU,CAMjD,OAAO,EAJL,EAAQ,OAAS,EACb,EAAU,EAAc,GAAmB,KAAK,OAAO,CACvD,EAAc,GAAmB,KAAK,OAAO,CAEpB,CAAC,MAAM,EAAG,GAA+B,CAe1E,SAAgB,GAAe,CAG7B,IAAM,EAAO,KAAK,KAAK,CAAC,SAAS,GAAkB,CAC7C,EAAQ,EAAQ,SAAS,GAAkB,CAO3C,EAAS,EAAW,GAAG,EAFhB,EAAc,GAAmB,KAAK,OAAO,CAEf,EAAQ,GAAa,GAAG,CAEnE,MAAO,GACL,GAAc,CACd,EAAO,MAAM,EAAG,KAAK,IAAI,EAAO,OAAS,EAAG,GAAkB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/cuid.d.ts
|
|
2
|
+
interface FingerprintOptions {
|
|
3
|
+
globalObj?: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Generate a random CUID
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
*
|
|
11
|
+
* // Generate a random CUID
|
|
12
|
+
* const id = cuid();
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @returns A random CUID string
|
|
16
|
+
*/
|
|
17
|
+
declare function cuid(): string;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { cuid as n, FingerprintOptions as t };
|
|
20
|
+
//# sourceMappingURL=cuid-DT9rtBzf.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cuid-DT9rtBzf.d.mts","names":[],"sources":["../src/cuid.ts"],"sourcesContent":[],"mappings":";UA6DiB,kBAAA;EAAA,SAAA,CAAA,EAAA,GAAA;AA0CjB;;;;;;;;;;;;;iBAAgB,IAAA,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/cuid.d.ts
|
|
2
|
+
interface FingerprintOptions {
|
|
3
|
+
globalObj?: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Generate a random CUID
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
*
|
|
11
|
+
* // Generate a random CUID
|
|
12
|
+
* const id = cuid();
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @returns A random CUID string
|
|
16
|
+
*/
|
|
17
|
+
declare function cuid(): string;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { cuid as n, FingerprintOptions as t };
|
|
20
|
+
//# sourceMappingURL=cuid-gUcp5l6X.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cuid-gUcp5l6X.d.cts","names":[],"sources":["../src/cuid.ts"],"sourcesContent":[],"mappings":";UA6DiB,kBAAA;EAAA,SAAA,CAAA,EAAA,GAAA;AA0CjB;;;;;;;;;;;;;iBAAgB,IAAA,CAAA"}
|
package/dist/cuid.cjs
CHANGED
|
@@ -1,30 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.cuid = cuid;
|
|
7
|
-
var _neutral = require("@stryke/hash/neutral");
|
|
8
|
-
var _random = require("./random.cjs");
|
|
9
|
-
const l = 476782367,
|
|
10
|
-
t = 36,
|
|
11
|
-
c = 1,
|
|
12
|
-
g = Math.floor(Math.random() * l) + c;
|
|
13
|
-
function i(o = 4, r = Math.random) {
|
|
14
|
-
let n = "";
|
|
15
|
-
for (; n.length < o;) n += Math.floor(r() * t).toString(t);
|
|
16
|
-
return n;
|
|
17
|
-
}
|
|
18
|
-
function h(o) {
|
|
19
|
-
const r = (o?.globalObj ?? typeof globalThis > "u") && typeof globalThis > "u" ? {} : globalThis,
|
|
20
|
-
n = Object.keys(r).toString(),
|
|
21
|
-
e = n.length > 0 ? n + i(t, Math.random) : i(t, Math.random);
|
|
22
|
-
return (0, _neutral.murmurhash)(e).slice(0, Math.max(0, t));
|
|
23
|
-
}
|
|
24
|
-
function cuid() {
|
|
25
|
-
const o = Date.now().toString(t),
|
|
26
|
-
r = g.toString(t),
|
|
27
|
-
n = i(t, Math.random),
|
|
28
|
-
e = (0, _neutral.murmurhash)(`${o + n + r + h()}`);
|
|
29
|
-
return `${(0, _random.randomLetter)() + e.slice(1, Math.min(e.length - 1, t))}`;
|
|
30
|
-
}
|
|
1
|
+
const e=require(`./cuid-BuvbHUZ8.cjs`);require(`./random-C4CrqJsp.cjs`),exports.cuid=e.t;
|
package/dist/cuid.d.cts
ADDED
package/dist/cuid.d.mts
ADDED
package/dist/cuid.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as e}from"./cuid-CcPQdiR_.mjs";import"./random-kTN0s0Jy.mjs";export{e as cuid};
|
package/dist/index.cjs
CHANGED
|
@@ -1,60 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _cuid = require("./cuid.cjs");
|
|
7
|
-
Object.keys(_cuid).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _cuid[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _cuid[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _nanoidClient = require("./nanoid-client.cjs");
|
|
18
|
-
Object.keys(_nanoidClient).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _nanoidClient[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _nanoidClient[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _random = require("./random.cjs");
|
|
29
|
-
Object.keys(_random).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _random[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _random[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _snowflake = require("./snowflake.cjs");
|
|
40
|
-
Object.keys(_snowflake).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _snowflake[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _snowflake[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
var _uuid = require("./uuid.cjs");
|
|
51
|
-
Object.keys(_uuid).forEach(function (key) {
|
|
52
|
-
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] === _uuid[key]) return;
|
|
54
|
-
Object.defineProperty(exports, key, {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _uuid[key];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
1
|
+
const e=require(`./cuid-BuvbHUZ8.cjs`),t=require(`./random-C4CrqJsp.cjs`),n=require(`./nanoid-client-DxgQ8Vt2.cjs`),r=require(`./snowflake-CLDXd54w.cjs`),i=require(`./uuid-BnD3hGTH.cjs`);exports.DEFAULT_EPOCH=r.t,exports.DEFAULT_SHARD_ID=r.n,exports.cuid=e.t,exports.deconstructSnowflake=r.r,exports.getNonCryptoRandomValues=t.t,exports.isValidSnowflake=r.i,exports.nanoid=n.t,exports.randomCharacters=t.n,exports.randomInteger=t.r,exports.randomLetter=t.i,exports.snowflake=r.a,exports.uuid=i.t;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { n as cuid, t as FingerprintOptions } from "./cuid-gUcp5l6X.cjs";
|
|
2
|
+
import { t as nanoid } from "./nanoid-client-mNAgNxsW.cjs";
|
|
3
|
+
import { i as randomLetter, n as randomCharacters, r as randomInteger, t as getNonCryptoRandomValues } from "./random-Bd2-oY2n.cjs";
|
|
4
|
+
import { a as SnowflakeResolvable, c as snowflake, i as SnowflakeGeneratorOptions, n as DEFAULT_SHARD_ID, o as deconstructSnowflake, r as DeconstructedSnowflake, s as isValidSnowflake, t as DEFAULT_EPOCH } from "./snowflake-DQmoRlnq.cjs";
|
|
5
|
+
import { t as uuid } from "./uuid-DCE9JeUQ.cjs";
|
|
6
|
+
export { DEFAULT_EPOCH, DEFAULT_SHARD_ID, DeconstructedSnowflake, FingerprintOptions, SnowflakeGeneratorOptions, SnowflakeResolvable, cuid, deconstructSnowflake, getNonCryptoRandomValues, isValidSnowflake, nanoid, randomCharacters, randomInteger, randomLetter, snowflake, uuid };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { n as cuid, t as FingerprintOptions } from "./cuid-DT9rtBzf.mjs";
|
|
2
|
+
import { t as nanoid } from "./nanoid-client-nC1JFvZD.mjs";
|
|
3
|
+
import { i as randomLetter, n as randomCharacters, r as randomInteger, t as getNonCryptoRandomValues } from "./random-DTxCCJYh.mjs";
|
|
4
|
+
import { a as SnowflakeResolvable, c as snowflake, i as SnowflakeGeneratorOptions, n as DEFAULT_SHARD_ID, o as deconstructSnowflake, r as DeconstructedSnowflake, s as isValidSnowflake, t as DEFAULT_EPOCH } from "./snowflake-B6ivA7bE.mjs";
|
|
5
|
+
import { t as uuid } from "./uuid-ByPTbUGJ.mjs";
|
|
6
|
+
export { DEFAULT_EPOCH, DEFAULT_SHARD_ID, DeconstructedSnowflake, FingerprintOptions, SnowflakeGeneratorOptions, SnowflakeResolvable, cuid, deconstructSnowflake, getNonCryptoRandomValues, isValidSnowflake, nanoid, randomCharacters, randomInteger, randomLetter, snowflake, uuid };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{t as e}from"./cuid-CcPQdiR_.mjs";import{i as t,n,r,t as i}from"./random-kTN0s0Jy.mjs";import{t as a}from"./nanoid-client-bEHxSBYB.mjs";import{a as o,i as s,n as c,r as l,t as u}from"./snowflake-BtoDXB99.mjs";import{t as d}from"./uuid-DSMliG_W.mjs";export{u as DEFAULT_EPOCH,c as DEFAULT_SHARD_ID,e as cuid,l as deconstructSnowflake,i as getNonCryptoRandomValues,s as isValidSnowflake,a as nanoid,n as randomCharacters,r as randomInteger,t as randomLetter,o as snowflake,d as uuid};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./random-C4CrqJsp.cjs`);function t(t=21){return e.t(new Uint8Array(t)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+=`-`:e+=`_`,e),``)}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nanoid-client-bEHxSBYB.mjs","names":[],"sources":["../src/nanoid-client.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { getNonCryptoRandomValues } from \"./random\";\n\n// This is taken from https://github.com/ai/nanoid/blob/main/index.browser.js We\n// copy this because we want to use `--platform=neutral` which doesn't work with\n// the npm package.\n// Also we changed the random number generator to use Math.random() for compat\n// with React Native.\n\n/**\n * A wrapper around the [nanoid](https://github.com/ai/nanoid) package with some modifications.\n *\n * @param size - The size of the string to generate\n * @returns A unique identifier following the nanoid format\n */\nexport function nanoid(size = 21): string {\n // Use our custom getRandomValues function to fill a Uint8Array with random values.\n const randomBytes = getNonCryptoRandomValues(new Uint8Array(size));\n\n return randomBytes.reduce((id, byte) => {\n // It is incorrect to use bytes exceeding the alphabet size.\n // The following mask reduces the random byte in the 0-255 value\n // range to the 0-63 value range. Therefore, adding hacks, such\n // as empty string fallback or magic numbers, is unnecessary because\n // the bitmask trims bytes down to the alphabet size.\n byte &= 63;\n if (byte < 36) {\n // `0-9a-z`\n id += byte.toString(36);\n } else if (byte < 62) {\n // `A-Z`\n id += (byte - 26).toString(36).toUpperCase();\n } else if (byte > 62) {\n id += \"-\";\n } else {\n id += \"_\";\n }\n return id;\n }, \"\");\n}\n"],"mappings":"0CAgCA,SAAgB,EAAO,EAAO,GAAY,CAIxC,OAFoB,EAAyB,IAAI,WAAW,EAAK,CAAC,CAE/C,QAAQ,EAAI,KAM7B,GAAQ,GACJ,EAAO,GAET,GAAM,EAAK,SAAS,GAAG,CACd,EAAO,GAEhB,IAAO,EAAO,IAAI,SAAS,GAAG,CAAC,aAAa,CACnC,EAAO,GAChB,GAAM,IAEN,GAAM,IAED,GACN,GAAG"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
//#region src/nanoid-client.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* A wrapper around the [nanoid](https://github.com/ai/nanoid) package with some modifications.
|
|
3
4
|
*
|
|
4
5
|
* @param size - The size of the string to generate
|
|
5
6
|
* @returns A unique identifier following the nanoid format
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
+
declare function nanoid(size?: number): string;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { nanoid as t };
|
|
11
|
+
//# sourceMappingURL=nanoid-client-mNAgNxsW.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nanoid-client-mNAgNxsW.d.cts","names":[],"sources":["../src/nanoid-client.ts"],"sourcesContent":[],"mappings":";;AAgCA;;;;;iBAAgB,MAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/nanoid-client.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A wrapper around the [nanoid](https://github.com/ai/nanoid) package with some modifications.
|
|
4
|
+
*
|
|
5
|
+
* @param size - The size of the string to generate
|
|
6
|
+
* @returns A unique identifier following the nanoid format
|
|
7
|
+
*/
|
|
8
|
+
declare function nanoid(size?: number): string;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { nanoid as t };
|
|
11
|
+
//# sourceMappingURL=nanoid-client-nC1JFvZD.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nanoid-client-nC1JFvZD.d.mts","names":[],"sources":["../src/nanoid-client.ts"],"sourcesContent":[],"mappings":";;AAgCA;;;;;iBAAgB,MAAA"}
|