typetify 2.1.0 → 2.4.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.
- package/CHANGELOG.md +131 -0
- package/README.md +108 -0
- package/dist/async/index.js +1 -49
- package/dist/async/index.mjs +1 -4
- package/dist/chunk-272Z3AXV.js +1 -0
- package/dist/chunk-2YRFWQ6M.mjs +1 -0
- package/dist/chunk-35CB7HNN.js +1 -0
- package/dist/chunk-4JG7CFRK.js +1 -0
- package/dist/chunk-5FBZYPQM.mjs +1 -0
- package/dist/chunk-5XQRYI2Q.mjs +1 -0
- package/dist/chunk-6HA2SN23.js +1 -0
- package/dist/chunk-6NWIIOHH.js +1 -0
- package/dist/chunk-6WGRWYAD.js +1 -0
- package/dist/chunk-7LBL6CYT.js +1 -0
- package/dist/chunk-7UMXGQE4.mjs +1 -0
- package/dist/chunk-7XHBEA63.js +1 -0
- package/dist/chunk-B3R73UK5.mjs +1 -0
- package/dist/chunk-BLUG7TSP.js +1 -0
- package/dist/chunk-EAHFED6V.mjs +1 -0
- package/dist/chunk-EKSHS4DL.mjs +1 -0
- package/dist/chunk-F76ECQKE.js +1 -0
- package/dist/chunk-FHCBXSNA.js +1 -0
- package/dist/chunk-GKOA3XGQ.js +1 -0
- package/dist/chunk-GQIJLGEZ.mjs +1 -0
- package/dist/chunk-I4YSQ4HB.js +1 -0
- package/dist/chunk-JZXLCA2E.mjs +1 -0
- package/dist/chunk-M5OMYDI7.mjs +1 -0
- package/dist/chunk-MB77QAOC.mjs +1 -0
- package/dist/chunk-MPY3WRLG.mjs +1 -0
- package/dist/chunk-NENRAPOL.mjs +1 -0
- package/dist/chunk-NOW4Q26G.mjs +1 -0
- package/dist/chunk-P4UNM7SF.js +1 -0
- package/dist/chunk-P5E2JDCX.mjs +1 -0
- package/dist/chunk-Q7SUL7MD.js +1 -0
- package/dist/chunk-QKNZICUO.mjs +1 -0
- package/dist/chunk-RHMANSTA.mjs +1 -0
- package/dist/chunk-SF64HETW.js +1 -0
- package/dist/chunk-T66YO63J.js +1 -0
- package/dist/chunk-TNK6EVQK.mjs +1 -0
- package/dist/chunk-TSJFKV3R.js +1 -0
- package/dist/chunk-TVCWWECJ.mjs +1 -0
- package/dist/chunk-U7MK5AR5.mjs +1 -0
- package/dist/chunk-W5I352FJ.js +1 -0
- package/dist/chunk-WAT4QJB2.js +1 -0
- package/dist/chunk-WCG5ODRX.mjs +1 -0
- package/dist/chunk-WDFIRO2J.js +1 -0
- package/dist/chunk-WOT6VMZA.js +1 -0
- package/dist/chunk-WS743BFA.js +1 -0
- package/dist/chunk-WWU7P2L2.mjs +1 -0
- package/dist/chunk-XPY5CWKZ.mjs +1 -0
- package/dist/collection/index.d.mts +125 -1
- package/dist/collection/index.d.ts +125 -1
- package/dist/collection/index.js +1 -125
- package/dist/collection/index.mjs +1 -4
- package/dist/color/index.d.mts +274 -0
- package/dist/color/index.d.ts +274 -0
- package/dist/color/index.js +1 -0
- package/dist/color/index.mjs +1 -0
- package/dist/core/index.js +1 -41
- package/dist/core/index.mjs +1 -4
- package/dist/decorator/index.js +1 -57
- package/dist/decorator/index.mjs +1 -4
- package/dist/dom/index.d.mts +353 -0
- package/dist/dom/index.d.ts +353 -0
- package/dist/dom/index.js +1 -0
- package/dist/dom/index.mjs +1 -0
- package/dist/dx/index.js +1 -53
- package/dist/dx/index.mjs +1 -4
- package/dist/flow/index.js +1 -50
- package/dist/flow/index.mjs +1 -5
- package/dist/fn/index.js +1 -37
- package/dist/fn/index.mjs +1 -4
- package/dist/guards/index.js +1 -233
- package/dist/guards/index.mjs +1 -4
- package/dist/index.d.mts +482 -410
- package/dist/index.d.ts +482 -410
- package/dist/index.js +3 -2507
- package/dist/index.mjs +3 -1546
- package/dist/input/index.js +1 -74
- package/dist/input/index.mjs +1 -5
- package/dist/iterator/index.js +1 -85
- package/dist/iterator/index.mjs +1 -4
- package/dist/logic/index.js +1 -201
- package/dist/logic/index.mjs +1 -4
- package/dist/math/index.js +1 -45
- package/dist/math/index.mjs +1 -4
- package/dist/narrowing/index.js +1 -141
- package/dist/narrowing/index.mjs +1 -4
- package/dist/object/index.d.mts +137 -1
- package/dist/object/index.d.ts +137 -1
- package/dist/object/index.js +1 -113
- package/dist/object/index.mjs +1 -4
- package/dist/result/index.js +1 -86
- package/dist/result/index.mjs +1 -5
- package/dist/schema/index.js +1 -110
- package/dist/schema/index.mjs +1 -5
- package/dist/storage/index.d.mts +197 -0
- package/dist/storage/index.d.ts +197 -0
- package/dist/storage/index.js +1 -0
- package/dist/storage/index.mjs +1 -0
- package/dist/string/index.d.mts +201 -1
- package/dist/string/index.d.ts +201 -1
- package/dist/string/index.js +1 -49
- package/dist/string/index.mjs +1 -4
- package/dist/typed/index.js +1 -193
- package/dist/typed/index.mjs +1 -4
- package/package.json +23 -3
- package/dist/async/index.js.map +0 -1
- package/dist/async/index.mjs.map +0 -1
- package/dist/chunk-2LJ6NZ6K.js +0 -108
- package/dist/chunk-2LJ6NZ6K.js.map +0 -1
- package/dist/chunk-4NXETABV.mjs +0 -116
- package/dist/chunk-4NXETABV.mjs.map +0 -1
- package/dist/chunk-6ZBTL74K.js +0 -129
- package/dist/chunk-6ZBTL74K.js.map +0 -1
- package/dist/chunk-7G4ZSMQX.js +0 -470
- package/dist/chunk-7G4ZSMQX.js.map +0 -1
- package/dist/chunk-CN3GYRJN.mjs +0 -137
- package/dist/chunk-CN3GYRJN.mjs.map +0 -1
- package/dist/chunk-CNTE6ZVH.js +0 -359
- package/dist/chunk-CNTE6ZVH.js.map +0 -1
- package/dist/chunk-CWHYQWNU.mjs +0 -224
- package/dist/chunk-CWHYQWNU.mjs.map +0 -1
- package/dist/chunk-DBENOSTA.js +0 -156
- package/dist/chunk-DBENOSTA.js.map +0 -1
- package/dist/chunk-DWIG5GF2.js +0 -135
- package/dist/chunk-DWIG5GF2.js.map +0 -1
- package/dist/chunk-EAUTTWTQ.mjs +0 -231
- package/dist/chunk-EAUTTWTQ.mjs.map +0 -1
- package/dist/chunk-FEX5C4OH.mjs +0 -1007
- package/dist/chunk-FEX5C4OH.mjs.map +0 -1
- package/dist/chunk-FN553YPU.js +0 -441
- package/dist/chunk-FN553YPU.js.map +0 -1
- package/dist/chunk-FT2EK4AM.mjs +0 -420
- package/dist/chunk-FT2EK4AM.mjs.map +0 -1
- package/dist/chunk-FXWYPHA3.mjs +0 -13
- package/dist/chunk-FXWYPHA3.mjs.map +0 -1
- package/dist/chunk-GS3PP67B.js +0 -200
- package/dist/chunk-GS3PP67B.js.map +0 -1
- package/dist/chunk-IGA3VEZM.mjs +0 -503
- package/dist/chunk-IGA3VEZM.mjs.map +0 -1
- package/dist/chunk-J5LGTIGS.mjs +0 -9
- package/dist/chunk-J5LGTIGS.mjs.map +0 -1
- package/dist/chunk-JB6UXRKD.mjs +0 -97
- package/dist/chunk-JB6UXRKD.mjs.map +0 -1
- package/dist/chunk-JQAQV75V.js +0 -561
- package/dist/chunk-JQAQV75V.js.map +0 -1
- package/dist/chunk-JQHUBZ4M.js +0 -88
- package/dist/chunk-JQHUBZ4M.js.map +0 -1
- package/dist/chunk-LT7JK7RJ.js +0 -87
- package/dist/chunk-LT7JK7RJ.js.map +0 -1
- package/dist/chunk-N6IUADIP.mjs +0 -414
- package/dist/chunk-N6IUADIP.mjs.map +0 -1
- package/dist/chunk-OEJK37LO.mjs +0 -328
- package/dist/chunk-OEJK37LO.mjs.map +0 -1
- package/dist/chunk-OKB3MS5F.js +0 -547
- package/dist/chunk-OKB3MS5F.js.map +0 -1
- package/dist/chunk-OPVES6W2.js +0 -16
- package/dist/chunk-OPVES6W2.js.map +0 -1
- package/dist/chunk-OWNUKWXV.js +0 -291
- package/dist/chunk-OWNUKWXV.js.map +0 -1
- package/dist/chunk-POD52NJ3.mjs +0 -526
- package/dist/chunk-POD52NJ3.mjs.map +0 -1
- package/dist/chunk-PQTXSQ4P.js +0 -369
- package/dist/chunk-PQTXSQ4P.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js +0 -11
- package/dist/chunk-PZ5AY32C.js.map +0 -1
- package/dist/chunk-QFR7DVAJ.mjs +0 -63
- package/dist/chunk-QFR7DVAJ.mjs.map +0 -1
- package/dist/chunk-S535LAXW.js +0 -1054
- package/dist/chunk-S535LAXW.js.map +0 -1
- package/dist/chunk-SGQNLTRK.js +0 -73
- package/dist/chunk-SGQNLTRK.js.map +0 -1
- package/dist/chunk-SRDWUHDY.mjs +0 -188
- package/dist/chunk-SRDWUHDY.mjs.map +0 -1
- package/dist/chunk-TXU7NTT4.js +0 -249
- package/dist/chunk-TXU7NTT4.js.map +0 -1
- package/dist/chunk-TZEWREAC.mjs +0 -277
- package/dist/chunk-TZEWREAC.mjs.map +0 -1
- package/dist/chunk-V6CWFDIJ.mjs +0 -123
- package/dist/chunk-V6CWFDIJ.mjs.map +0 -1
- package/dist/chunk-X55EORNF.js +0 -259
- package/dist/chunk-X55EORNF.js.map +0 -1
- package/dist/chunk-YBJC5WMX.mjs +0 -341
- package/dist/chunk-YBJC5WMX.mjs.map +0 -1
- package/dist/chunk-YOPAXITF.mjs +0 -75
- package/dist/chunk-YOPAXITF.mjs.map +0 -1
- package/dist/chunk-ZE4FDBRI.mjs +0 -79
- package/dist/chunk-ZE4FDBRI.mjs.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/index.mjs.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/index.mjs.map +0 -1
- package/dist/decorator/index.js.map +0 -1
- package/dist/decorator/index.mjs.map +0 -1
- package/dist/dx/index.js.map +0 -1
- package/dist/dx/index.mjs.map +0 -1
- package/dist/flow/index.js.map +0 -1
- package/dist/flow/index.mjs.map +0 -1
- package/dist/fn/index.js.map +0 -1
- package/dist/fn/index.mjs.map +0 -1
- package/dist/guards/index.js.map +0 -1
- package/dist/guards/index.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/input/index.js.map +0 -1
- package/dist/input/index.mjs.map +0 -1
- package/dist/iterator/index.js.map +0 -1
- package/dist/iterator/index.mjs.map +0 -1
- package/dist/logic/index.js.map +0 -1
- package/dist/logic/index.mjs.map +0 -1
- package/dist/math/index.js.map +0 -1
- package/dist/math/index.mjs.map +0 -1
- package/dist/narrowing/index.js.map +0 -1
- package/dist/narrowing/index.mjs.map +0 -1
- package/dist/object/index.js.map +0 -1
- package/dist/object/index.mjs.map +0 -1
- package/dist/result/index.js.map +0 -1
- package/dist/result/index.mjs.map +0 -1
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/index.mjs.map +0 -1
- package/dist/string/index.js.map +0 -1
- package/dist/string/index.mjs.map +0 -1
- package/dist/typed/index.js.map +0 -1
- package/dist/typed/index.mjs.map +0 -1
package/dist/string/index.d.ts
CHANGED
|
@@ -99,4 +99,204 @@ declare function template(str: string, vars: Record<string, unknown>): string;
|
|
|
99
99
|
*/
|
|
100
100
|
declare function words(str: string): string[];
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Removes diacritical marks (accents) from a string.
|
|
104
|
+
* Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin letters.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* // Remove French accents
|
|
108
|
+
* deburr('déjà vu')
|
|
109
|
+
* // => 'deja vu'
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* // Remove German umlauts
|
|
113
|
+
* deburr('Müller')
|
|
114
|
+
* // => 'Muller'
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* // Remove Spanish accents
|
|
118
|
+
* deburr('señor')
|
|
119
|
+
* // => 'senor'
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* // Useful for search/filtering
|
|
123
|
+
* const users = ['José', 'François', 'Müller']
|
|
124
|
+
* const search = 'jose'
|
|
125
|
+
* users.filter(name => deburr(name).toLowerCase().includes(search))
|
|
126
|
+
* // => ['José']
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* // Create URL-safe slugs
|
|
130
|
+
* deburr('Crème brûlée').toLowerCase().replace(/\s+/g, '-')
|
|
131
|
+
* // => 'creme-brulee'
|
|
132
|
+
*/
|
|
133
|
+
declare function deburr(str: string): string;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Escapes HTML special characters to prevent XSS attacks.
|
|
137
|
+
* Converts &, <, >, ", and ' to their HTML entity equivalents.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* // Escape user input before rendering
|
|
141
|
+
* escape('<script>alert("xss")</script>')
|
|
142
|
+
* // => '<script>alert("xss")</script>'
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* // Escape ampersands
|
|
146
|
+
* escape('Tom & Jerry')
|
|
147
|
+
* // => 'Tom & Jerry'
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* // Escape quotes in attributes
|
|
151
|
+
* escape('He said "Hello"')
|
|
152
|
+
* // => 'He said "Hello"'
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* // Safe to use in innerHTML
|
|
156
|
+
* const userInput = '<img src=x onerror=alert(1)>'
|
|
157
|
+
* element.innerHTML = escape(userInput)
|
|
158
|
+
* // Renders as text, not as HTML
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* // Escape single quotes
|
|
162
|
+
* escape("It's a test")
|
|
163
|
+
* // => 'It's a test'
|
|
164
|
+
*/
|
|
165
|
+
declare function escape(str: string): string;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Converts HTML entities back to their corresponding characters.
|
|
169
|
+
* Inverse of escape().
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* // Unescape HTML entities
|
|
173
|
+
* unescape('<script>')
|
|
174
|
+
* // => '<script>'
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* // Unescape ampersands
|
|
178
|
+
* unescape('Tom & Jerry')
|
|
179
|
+
* // => 'Tom & Jerry'
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* // Unescape quotes
|
|
183
|
+
* unescape('He said "Hello"')
|
|
184
|
+
* // => 'He said "Hello"'
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* // Parse escaped content from API
|
|
188
|
+
* const apiResponse = { title: 'Rock & Roll' }
|
|
189
|
+
* unescape(apiResponse.title)
|
|
190
|
+
* // => 'Rock & Roll'
|
|
191
|
+
*/
|
|
192
|
+
declare function unescape(str: string): string;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Escapes special RegExp characters in a string.
|
|
196
|
+
* Useful when building dynamic regular expressions from user input.
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* // Escape special characters
|
|
200
|
+
* escapeRegExp('[lodash](https://lodash.com/)')
|
|
201
|
+
* // => '\\[lodash\\]\\(https://lodash\\.com/\\)'
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* // Safe dynamic regex from user input
|
|
205
|
+
* const userSearch = 'price: $100'
|
|
206
|
+
* const regex = new RegExp(escapeRegExp(userSearch), 'i')
|
|
207
|
+
* regex.test('The price: $100 is final') // => true
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* // Highlight search terms safely
|
|
211
|
+
* function highlightText(text: string, search: string) {
|
|
212
|
+
* const escaped = escapeRegExp(search)
|
|
213
|
+
* return text.replace(new RegExp(escaped, 'gi'), '<mark>$&</mark>')
|
|
214
|
+
* }
|
|
215
|
+
* highlightText('Hello (world)', '(world)')
|
|
216
|
+
* // => 'Hello <mark>(world)</mark>'
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* // Build complex patterns safely
|
|
220
|
+
* const terms = ['C++', 'C#', '.NET']
|
|
221
|
+
* const pattern = terms.map(escapeRegExp).join('|')
|
|
222
|
+
* const regex = new RegExp(pattern, 'g')
|
|
223
|
+
* 'I know C++ and .NET'.match(regex)
|
|
224
|
+
* // => ['C++', '.NET']
|
|
225
|
+
*/
|
|
226
|
+
declare function escapeRegExp(str: string): string;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Pads a string on both sides to reach the target length.
|
|
230
|
+
* If the padding length is odd, the extra character goes to the right.
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* // Center text
|
|
234
|
+
* pad('hello', 11)
|
|
235
|
+
* // => ' hello '
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* // Custom padding character
|
|
239
|
+
* pad('5', 3, '0')
|
|
240
|
+
* // => '050'
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* // Center with dashes
|
|
244
|
+
* pad('TITLE', 15, '-')
|
|
245
|
+
* // => '-----TITLE-----'
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* // No padding if already long enough
|
|
249
|
+
* pad('hello', 3)
|
|
250
|
+
* // => 'hello'
|
|
251
|
+
*/
|
|
252
|
+
declare function pad(str: string, length: number, chars?: string): string;
|
|
253
|
+
/**
|
|
254
|
+
* Pads a string on the left (start) to reach the target length.
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* // Pad numbers with zeros
|
|
258
|
+
* padStart('5', 3, '0')
|
|
259
|
+
* // => '005'
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* // Format time components
|
|
263
|
+
* padStart('9', 2, '0')
|
|
264
|
+
* // => '09'
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* // Align text to the right
|
|
268
|
+
* padStart('42', 5)
|
|
269
|
+
* // => ' 42'
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* // Format IDs
|
|
273
|
+
* padStart('123', 8, '0')
|
|
274
|
+
* // => '00000123'
|
|
275
|
+
*/
|
|
276
|
+
declare function padStart(str: string, length: number, chars?: string): string;
|
|
277
|
+
/**
|
|
278
|
+
* Pads a string on the right (end) to reach the target length.
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* // Align text to the left
|
|
282
|
+
* padEnd('hello', 10)
|
|
283
|
+
* // => 'hello '
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* // Create fixed-width columns
|
|
287
|
+
* padEnd('Name', 20) + padEnd('Age', 5)
|
|
288
|
+
* // => 'Name Age '
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* // Pad with custom character
|
|
292
|
+
* padEnd('1', 4, '0')
|
|
293
|
+
* // => '1000'
|
|
294
|
+
*
|
|
295
|
+
* @example
|
|
296
|
+
* // Format file sizes
|
|
297
|
+
* padEnd('1.5', 6, '0') + ' MB'
|
|
298
|
+
* // => '1.5000 MB'
|
|
299
|
+
*/
|
|
300
|
+
declare function padEnd(str: string, length: number, chars?: string): string;
|
|
301
|
+
|
|
302
|
+
export { camelCase, capitalize, deburr, escape, escapeRegExp, kebabCase, pad, padEnd, padStart, pascalCase, slugify, snakeCase, template, truncate, uncapitalize, unescape, words };
|
package/dist/string/index.js
CHANGED
|
@@ -1,49 +1 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkLT7JK7RJ_js = require('../chunk-LT7JK7RJ.js');
|
|
4
|
-
require('../chunk-PZ5AY32C.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "camelCase", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunkLT7JK7RJ_js.camelCase; }
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "capitalize", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return chunkLT7JK7RJ_js.capitalize; }
|
|
15
|
-
});
|
|
16
|
-
Object.defineProperty(exports, "kebabCase", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () { return chunkLT7JK7RJ_js.kebabCase; }
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(exports, "pascalCase", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function () { return chunkLT7JK7RJ_js.pascalCase; }
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "slugify", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () { return chunkLT7JK7RJ_js.slugify; }
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports, "snakeCase", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function () { return chunkLT7JK7RJ_js.snakeCase; }
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(exports, "template", {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () { return chunkLT7JK7RJ_js.template; }
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "truncate", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () { return chunkLT7JK7RJ_js.truncate; }
|
|
39
|
-
});
|
|
40
|
-
Object.defineProperty(exports, "uncapitalize", {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
get: function () { return chunkLT7JK7RJ_js.uncapitalize; }
|
|
43
|
-
});
|
|
44
|
-
Object.defineProperty(exports, "words", {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
get: function () { return chunkLT7JK7RJ_js.words; }
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=index.js.map
|
|
49
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';var chunk6WGRWYAD_js=require('../chunk-6WGRWYAD.js');require('../chunk-WOT6VMZA.js');Object.defineProperty(exports,"camelCase",{enumerable:true,get:function(){return chunk6WGRWYAD_js.c}});Object.defineProperty(exports,"capitalize",{enumerable:true,get:function(){return chunk6WGRWYAD_js.a}});Object.defineProperty(exports,"deburr",{enumerable:true,get:function(){return chunk6WGRWYAD_js.k}});Object.defineProperty(exports,"escape",{enumerable:true,get:function(){return chunk6WGRWYAD_js.l}});Object.defineProperty(exports,"escapeRegExp",{enumerable:true,get:function(){return chunk6WGRWYAD_js.n}});Object.defineProperty(exports,"kebabCase",{enumerable:true,get:function(){return chunk6WGRWYAD_js.d}});Object.defineProperty(exports,"pad",{enumerable:true,get:function(){return chunk6WGRWYAD_js.o}});Object.defineProperty(exports,"padEnd",{enumerable:true,get:function(){return chunk6WGRWYAD_js.q}});Object.defineProperty(exports,"padStart",{enumerable:true,get:function(){return chunk6WGRWYAD_js.p}});Object.defineProperty(exports,"pascalCase",{enumerable:true,get:function(){return chunk6WGRWYAD_js.f}});Object.defineProperty(exports,"slugify",{enumerable:true,get:function(){return chunk6WGRWYAD_js.h}});Object.defineProperty(exports,"snakeCase",{enumerable:true,get:function(){return chunk6WGRWYAD_js.e}});Object.defineProperty(exports,"template",{enumerable:true,get:function(){return chunk6WGRWYAD_js.i}});Object.defineProperty(exports,"truncate",{enumerable:true,get:function(){return chunk6WGRWYAD_js.g}});Object.defineProperty(exports,"uncapitalize",{enumerable:true,get:function(){return chunk6WGRWYAD_js.b}});Object.defineProperty(exports,"unescape",{enumerable:true,get:function(){return chunk6WGRWYAD_js.m}});Object.defineProperty(exports,"words",{enumerable:true,get:function(){return chunk6WGRWYAD_js.j}});
|
package/dist/string/index.mjs
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
import '../chunk-J5LGTIGS.mjs';
|
|
3
|
-
//# sourceMappingURL=index.mjs.map
|
|
4
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
export{c as camelCase,a as capitalize,k as deburr,l as escape,n as escapeRegExp,d as kebabCase,o as pad,q as padEnd,p as padStart,f as pascalCase,h as slugify,e as snakeCase,i as template,g as truncate,b as uncapitalize,m as unescape,j as words}from'../chunk-2YRFWQ6M.mjs';import'../chunk-JZXLCA2E.mjs';
|
package/dist/typed/index.js
CHANGED
|
@@ -1,193 +1 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkS535LAXW_js = require('../chunk-S535LAXW.js');
|
|
4
|
-
require('../chunk-PZ5AY32C.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "assertTypeDebug", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunkS535LAXW_js.assertType; }
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "asyncData", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return chunkS535LAXW_js.asyncData; }
|
|
15
|
-
});
|
|
16
|
-
Object.defineProperty(exports, "brand", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () { return chunkS535LAXW_js.brand; }
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(exports, "collection", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function () { return chunkS535LAXW_js.collection; }
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "collectionWithId", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () { return chunkS535LAXW_js.collectionWithId; }
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports, "createActions", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function () { return chunkS535LAXW_js.createActions; }
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(exports, "createBuilder", {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () { return chunkS535LAXW_js.createBuilder; }
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "createCollection", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () { return chunkS535LAXW_js.createCollection; }
|
|
39
|
-
});
|
|
40
|
-
Object.defineProperty(exports, "createMap", {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
get: function () { return chunkS535LAXW_js.createMap; }
|
|
43
|
-
});
|
|
44
|
-
Object.defineProperty(exports, "createMatcher", {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
get: function () { return chunkS535LAXW_js.createMatcher; }
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "createReducer", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () { return chunkS535LAXW_js.createReducer; }
|
|
51
|
-
});
|
|
52
|
-
Object.defineProperty(exports, "createSet", {
|
|
53
|
-
enumerable: true,
|
|
54
|
-
get: function () { return chunkS535LAXW_js.createSet; }
|
|
55
|
-
});
|
|
56
|
-
Object.defineProperty(exports, "createTypedEmitter", {
|
|
57
|
-
enumerable: true,
|
|
58
|
-
get: function () { return chunkS535LAXW_js.createTypedEmitter; }
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(exports, "deepMergeFn", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function () { return chunkS535LAXW_js.deepMerge; }
|
|
63
|
-
});
|
|
64
|
-
Object.defineProperty(exports, "defineConst", {
|
|
65
|
-
enumerable: true,
|
|
66
|
-
get: function () { return chunkS535LAXW_js.defineConst; }
|
|
67
|
-
});
|
|
68
|
-
Object.defineProperty(exports, "defineEnum", {
|
|
69
|
-
enumerable: true,
|
|
70
|
-
get: function () { return chunkS535LAXW_js.defineEnum; }
|
|
71
|
-
});
|
|
72
|
-
Object.defineProperty(exports, "defineModel", {
|
|
73
|
-
enumerable: true,
|
|
74
|
-
get: function () { return chunkS535LAXW_js.defineModel; }
|
|
75
|
-
});
|
|
76
|
-
Object.defineProperty(exports, "defineStateMachine", {
|
|
77
|
-
enumerable: true,
|
|
78
|
-
get: function () { return chunkS535LAXW_js.defineStateMachine; }
|
|
79
|
-
});
|
|
80
|
-
Object.defineProperty(exports, "defineTuple", {
|
|
81
|
-
enumerable: true,
|
|
82
|
-
get: function () { return chunkS535LAXW_js.defineTuple; }
|
|
83
|
-
});
|
|
84
|
-
Object.defineProperty(exports, "formState", {
|
|
85
|
-
enumerable: true,
|
|
86
|
-
get: function () { return chunkS535LAXW_js.formState; }
|
|
87
|
-
});
|
|
88
|
-
Object.defineProperty(exports, "fromEntries", {
|
|
89
|
-
enumerable: true,
|
|
90
|
-
get: function () { return chunkS535LAXW_js.fromEntries; }
|
|
91
|
-
});
|
|
92
|
-
Object.defineProperty(exports, "identityTyped", {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
get: function () { return chunkS535LAXW_js.identity; }
|
|
95
|
-
});
|
|
96
|
-
Object.defineProperty(exports, "impossible", {
|
|
97
|
-
enumerable: true,
|
|
98
|
-
get: function () { return chunkS535LAXW_js.impossible; }
|
|
99
|
-
});
|
|
100
|
-
Object.defineProperty(exports, "mapKeys", {
|
|
101
|
-
enumerable: true,
|
|
102
|
-
get: function () { return chunkS535LAXW_js.mapKeys; }
|
|
103
|
-
});
|
|
104
|
-
Object.defineProperty(exports, "mapValues", {
|
|
105
|
-
enumerable: true,
|
|
106
|
-
get: function () { return chunkS535LAXW_js.mapValues; }
|
|
107
|
-
});
|
|
108
|
-
Object.defineProperty(exports, "match", {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
get: function () { return chunkS535LAXW_js.match; }
|
|
111
|
-
});
|
|
112
|
-
Object.defineProperty(exports, "matchUnion", {
|
|
113
|
-
enumerable: true,
|
|
114
|
-
get: function () { return chunkS535LAXW_js.matchUnion; }
|
|
115
|
-
});
|
|
116
|
-
Object.defineProperty(exports, "matchValue", {
|
|
117
|
-
enumerable: true,
|
|
118
|
-
get: function () { return chunkS535LAXW_js.matchValue; }
|
|
119
|
-
});
|
|
120
|
-
Object.defineProperty(exports, "merge", {
|
|
121
|
-
enumerable: true,
|
|
122
|
-
get: function () { return chunkS535LAXW_js.merge; }
|
|
123
|
-
});
|
|
124
|
-
Object.defineProperty(exports, "mergeAllFn", {
|
|
125
|
-
enumerable: true,
|
|
126
|
-
get: function () { return chunkS535LAXW_js.mergeAll; }
|
|
127
|
-
});
|
|
128
|
-
Object.defineProperty(exports, "mergeModels", {
|
|
129
|
-
enumerable: true,
|
|
130
|
-
get: function () { return chunkS535LAXW_js.mergeModels; }
|
|
131
|
-
});
|
|
132
|
-
Object.defineProperty(exports, "mergeWith", {
|
|
133
|
-
enumerable: true,
|
|
134
|
-
get: function () { return chunkS535LAXW_js.mergeWith; }
|
|
135
|
-
});
|
|
136
|
-
Object.defineProperty(exports, "modalState", {
|
|
137
|
-
enumerable: true,
|
|
138
|
-
get: function () { return chunkS535LAXW_js.modalState; }
|
|
139
|
-
});
|
|
140
|
-
Object.defineProperty(exports, "model", {
|
|
141
|
-
enumerable: true,
|
|
142
|
-
get: function () { return chunkS535LAXW_js.model; }
|
|
143
|
-
});
|
|
144
|
-
Object.defineProperty(exports, "narrow", {
|
|
145
|
-
enumerable: true,
|
|
146
|
-
get: function () { return chunkS535LAXW_js.narrow; }
|
|
147
|
-
});
|
|
148
|
-
Object.defineProperty(exports, "narrowTyped", {
|
|
149
|
-
enumerable: true,
|
|
150
|
-
get: function () { return chunkS535LAXW_js.narrow2; }
|
|
151
|
-
});
|
|
152
|
-
Object.defineProperty(exports, "omitModel", {
|
|
153
|
-
enumerable: true,
|
|
154
|
-
get: function () { return chunkS535LAXW_js.omitModel; }
|
|
155
|
-
});
|
|
156
|
-
Object.defineProperty(exports, "omitTyped", {
|
|
157
|
-
enumerable: true,
|
|
158
|
-
get: function () { return chunkS535LAXW_js.omit; }
|
|
159
|
-
});
|
|
160
|
-
Object.defineProperty(exports, "persistentCollection", {
|
|
161
|
-
enumerable: true,
|
|
162
|
-
get: function () { return chunkS535LAXW_js.persistentCollection; }
|
|
163
|
-
});
|
|
164
|
-
Object.defineProperty(exports, "pickModel", {
|
|
165
|
-
enumerable: true,
|
|
166
|
-
get: function () { return chunkS535LAXW_js.pickModel; }
|
|
167
|
-
});
|
|
168
|
-
Object.defineProperty(exports, "pickTyped", {
|
|
169
|
-
enumerable: true,
|
|
170
|
-
get: function () { return chunkS535LAXW_js.pick; }
|
|
171
|
-
});
|
|
172
|
-
Object.defineProperty(exports, "renameKeys", {
|
|
173
|
-
enumerable: true,
|
|
174
|
-
get: function () { return chunkS535LAXW_js.renameKeys; }
|
|
175
|
-
});
|
|
176
|
-
Object.defineProperty(exports, "showType", {
|
|
177
|
-
enumerable: true,
|
|
178
|
-
get: function () { return chunkS535LAXW_js.showType; }
|
|
179
|
-
});
|
|
180
|
-
Object.defineProperty(exports, "t", {
|
|
181
|
-
enumerable: true,
|
|
182
|
-
get: function () { return chunkS535LAXW_js.t; }
|
|
183
|
-
});
|
|
184
|
-
Object.defineProperty(exports, "undoable", {
|
|
185
|
-
enumerable: true,
|
|
186
|
-
get: function () { return chunkS535LAXW_js.undoable; }
|
|
187
|
-
});
|
|
188
|
-
Object.defineProperty(exports, "v", {
|
|
189
|
-
enumerable: true,
|
|
190
|
-
get: function () { return chunkS535LAXW_js.v; }
|
|
191
|
-
});
|
|
192
|
-
//# sourceMappingURL=index.js.map
|
|
193
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';var chunk6NWIIOHH_js=require('../chunk-6NWIIOHH.js');require('../chunk-WOT6VMZA.js');Object.defineProperty(exports,"assertTypeDebug",{enumerable:true,get:function(){return chunk6NWIIOHH_js.G}});Object.defineProperty(exports,"asyncData",{enumerable:true,get:function(){return chunk6NWIIOHH_js.x}});Object.defineProperty(exports,"brand",{enumerable:true,get:function(){return chunk6NWIIOHH_js.f}});Object.defineProperty(exports,"collection",{enumerable:true,get:function(){return chunk6NWIIOHH_js.t}});Object.defineProperty(exports,"collectionWithId",{enumerable:true,get:function(){return chunk6NWIIOHH_js.u}});Object.defineProperty(exports,"createActions",{enumerable:true,get:function(){return chunk6NWIIOHH_js.j}});Object.defineProperty(exports,"createBuilder",{enumerable:true,get:function(){return chunk6NWIIOHH_js.h}});Object.defineProperty(exports,"createCollection",{enumerable:true,get:function(){return chunk6NWIIOHH_js.w}});Object.defineProperty(exports,"createMap",{enumerable:true,get:function(){return chunk6NWIIOHH_js.d}});Object.defineProperty(exports,"createMatcher",{enumerable:true,get:function(){return chunk6NWIIOHH_js.E}});Object.defineProperty(exports,"createReducer",{enumerable:true,get:function(){return chunk6NWIIOHH_js.l}});Object.defineProperty(exports,"createSet",{enumerable:true,get:function(){return chunk6NWIIOHH_js.e}});Object.defineProperty(exports,"createTypedEmitter",{enumerable:true,get:function(){return chunk6NWIIOHH_js.k}});Object.defineProperty(exports,"deepMergeFn",{enumerable:true,get:function(){return chunk6NWIIOHH_js.M}});Object.defineProperty(exports,"defineConst",{enumerable:true,get:function(){return chunk6NWIIOHH_js.a}});Object.defineProperty(exports,"defineEnum",{enumerable:true,get:function(){return chunk6NWIIOHH_js.b}});Object.defineProperty(exports,"defineModel",{enumerable:true,get:function(){return chunk6NWIIOHH_js.n}});Object.defineProperty(exports,"defineStateMachine",{enumerable:true,get:function(){return chunk6NWIIOHH_js.i}});Object.defineProperty(exports,"defineTuple",{enumerable:true,get:function(){return chunk6NWIIOHH_js.c}});Object.defineProperty(exports,"formState",{enumerable:true,get:function(){return chunk6NWIIOHH_js.y}});Object.defineProperty(exports,"fromEntries",{enumerable:true,get:function(){return chunk6NWIIOHH_js.R}});Object.defineProperty(exports,"identityTyped",{enumerable:true,get:function(){return chunk6NWIIOHH_js.I}});Object.defineProperty(exports,"impossible",{enumerable:true,get:function(){return chunk6NWIIOHH_js.H}});Object.defineProperty(exports,"mapKeys",{enumerable:true,get:function(){return chunk6NWIIOHH_js.T}});Object.defineProperty(exports,"mapValues",{enumerable:true,get:function(){return chunk6NWIIOHH_js.S}});Object.defineProperty(exports,"match",{enumerable:true,get:function(){return chunk6NWIIOHH_js.B}});Object.defineProperty(exports,"matchUnion",{enumerable:true,get:function(){return chunk6NWIIOHH_js.D}});Object.defineProperty(exports,"matchValue",{enumerable:true,get:function(){return chunk6NWIIOHH_js.C}});Object.defineProperty(exports,"merge",{enumerable:true,get:function(){return chunk6NWIIOHH_js.K}});Object.defineProperty(exports,"mergeAllFn",{enumerable:true,get:function(){return chunk6NWIIOHH_js.L}});Object.defineProperty(exports,"mergeModels",{enumerable:true,get:function(){return chunk6NWIIOHH_js.p}});Object.defineProperty(exports,"mergeWith",{enumerable:true,get:function(){return chunk6NWIIOHH_js.N}});Object.defineProperty(exports,"modalState",{enumerable:true,get:function(){return chunk6NWIIOHH_js.z}});Object.defineProperty(exports,"model",{enumerable:true,get:function(){return chunk6NWIIOHH_js.o}});Object.defineProperty(exports,"narrow",{enumerable:true,get:function(){return chunk6NWIIOHH_js.g}});Object.defineProperty(exports,"narrowTyped",{enumerable:true,get:function(){return chunk6NWIIOHH_js.J}});Object.defineProperty(exports,"omitModel",{enumerable:true,get:function(){return chunk6NWIIOHH_js.r}});Object.defineProperty(exports,"omitTyped",{enumerable:true,get:function(){return chunk6NWIIOHH_js.P}});Object.defineProperty(exports,"persistentCollection",{enumerable:true,get:function(){return chunk6NWIIOHH_js.v}});Object.defineProperty(exports,"pickModel",{enumerable:true,get:function(){return chunk6NWIIOHH_js.q}});Object.defineProperty(exports,"pickTyped",{enumerable:true,get:function(){return chunk6NWIIOHH_js.O}});Object.defineProperty(exports,"renameKeys",{enumerable:true,get:function(){return chunk6NWIIOHH_js.Q}});Object.defineProperty(exports,"showType",{enumerable:true,get:function(){return chunk6NWIIOHH_js.F}});Object.defineProperty(exports,"t",{enumerable:true,get:function(){return chunk6NWIIOHH_js.m}});Object.defineProperty(exports,"undoable",{enumerable:true,get:function(){return chunk6NWIIOHH_js.A}});Object.defineProperty(exports,"v",{enumerable:true,get:function(){return chunk6NWIIOHH_js.s}});
|
package/dist/typed/index.mjs
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
import '../chunk-J5LGTIGS.mjs';
|
|
3
|
-
//# sourceMappingURL=index.mjs.map
|
|
4
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
export{G as assertTypeDebug,x as asyncData,f as brand,t as collection,u as collectionWithId,j as createActions,h as createBuilder,w as createCollection,d as createMap,E as createMatcher,l as createReducer,e as createSet,k as createTypedEmitter,M as deepMergeFn,a as defineConst,b as defineEnum,n as defineModel,i as defineStateMachine,c as defineTuple,y as formState,R as fromEntries,I as identityTyped,H as impossible,T as mapKeys,S as mapValues,B as match,D as matchUnion,C as matchValue,K as merge,L as mergeAllFn,p as mergeModels,N as mergeWith,z as modalState,o as model,g as narrow,J as narrowTyped,r as omitModel,P as omitTyped,v as persistentCollection,q as pickModel,O as pickTyped,Q as renameKeys,F as showType,m as t,A as undoable,s as v}from'../chunk-M5OMYDI7.mjs';import'../chunk-JZXLCA2E.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typetify",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Runtime TypeScript helpers - like Lodash, but TS-first",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -100,10 +100,28 @@
|
|
|
100
100
|
"types": "./dist/schema/index.d.ts",
|
|
101
101
|
"import": "./dist/schema/index.mjs",
|
|
102
102
|
"require": "./dist/schema/index.js"
|
|
103
|
+
},
|
|
104
|
+
"./dom": {
|
|
105
|
+
"types": "./dist/dom/index.d.ts",
|
|
106
|
+
"import": "./dist/dom/index.mjs",
|
|
107
|
+
"require": "./dist/dom/index.js"
|
|
108
|
+
},
|
|
109
|
+
"./storage": {
|
|
110
|
+
"types": "./dist/storage/index.d.ts",
|
|
111
|
+
"import": "./dist/storage/index.mjs",
|
|
112
|
+
"require": "./dist/storage/index.js"
|
|
113
|
+
},
|
|
114
|
+
"./color": {
|
|
115
|
+
"types": "./dist/color/index.d.ts",
|
|
116
|
+
"import": "./dist/color/index.mjs",
|
|
117
|
+
"require": "./dist/color/index.js"
|
|
103
118
|
}
|
|
104
119
|
},
|
|
105
120
|
"files": [
|
|
106
|
-
"dist"
|
|
121
|
+
"dist",
|
|
122
|
+
"README.md",
|
|
123
|
+
"CHANGELOG.md",
|
|
124
|
+
"LICENSE"
|
|
107
125
|
],
|
|
108
126
|
"scripts": {
|
|
109
127
|
"build": "tsup",
|
|
@@ -113,7 +131,9 @@
|
|
|
113
131
|
"typecheck": "tsc --noEmit",
|
|
114
132
|
"lint": "eslint src --ext .ts",
|
|
115
133
|
"prepublishOnly": "npm run typecheck && npm run test && npm run build",
|
|
116
|
-
"prepare": "npm run build"
|
|
134
|
+
"prepare": "npm run build",
|
|
135
|
+
"analyze": "npm pack --dry-run",
|
|
136
|
+
"size": "npm pack && tar -xvzf *.tgz && du -sh package && rm -rf package *.tgz"
|
|
117
137
|
},
|
|
118
138
|
"publishConfig": {
|
|
119
139
|
"access": "public"
|
package/dist/async/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/async/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
|
package/dist/chunk-2LJ6NZ6K.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkPZ5AY32C_js = require('./chunk-PZ5AY32C.js');
|
|
4
|
-
|
|
5
|
-
// src/math/index.ts
|
|
6
|
-
var math_exports = {};
|
|
7
|
-
chunkPZ5AY32C_js.__export(math_exports, {
|
|
8
|
-
average: () => average,
|
|
9
|
-
max: () => max,
|
|
10
|
-
median: () => median,
|
|
11
|
-
min: () => min,
|
|
12
|
-
percentage: () => percentage,
|
|
13
|
-
randomFloat: () => randomFloat,
|
|
14
|
-
randomInt: () => randomInt,
|
|
15
|
-
round: () => round,
|
|
16
|
-
sum: () => sum
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
// src/math/sum.ts
|
|
20
|
-
function sum(numbers) {
|
|
21
|
-
let total = 0;
|
|
22
|
-
for (const n of numbers) {
|
|
23
|
-
total += n;
|
|
24
|
-
}
|
|
25
|
-
return total;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// src/math/average.ts
|
|
29
|
-
function average(numbers) {
|
|
30
|
-
if (numbers.length === 0) return NaN;
|
|
31
|
-
let total = 0;
|
|
32
|
-
for (const n of numbers) {
|
|
33
|
-
total += n;
|
|
34
|
-
}
|
|
35
|
-
return total / numbers.length;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// src/math/median.ts
|
|
39
|
-
function median(numbers) {
|
|
40
|
-
if (numbers.length === 0) return NaN;
|
|
41
|
-
const sorted = [...numbers].sort((a, b) => a - b);
|
|
42
|
-
const mid = Math.floor(sorted.length / 2);
|
|
43
|
-
if (sorted.length % 2 === 0) {
|
|
44
|
-
return (sorted[mid - 1] + sorted[mid]) / 2;
|
|
45
|
-
}
|
|
46
|
-
return sorted[mid];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// src/math/round.ts
|
|
50
|
-
function round(num, precision = 0) {
|
|
51
|
-
const factor = Math.pow(10, precision);
|
|
52
|
-
return Math.round(num * factor) / factor;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// src/math/randomInt.ts
|
|
56
|
-
function randomInt(min2, max2) {
|
|
57
|
-
min2 = Math.ceil(min2);
|
|
58
|
-
max2 = Math.floor(max2);
|
|
59
|
-
return Math.floor(Math.random() * (max2 - min2 + 1)) + min2;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// src/math/randomFloat.ts
|
|
63
|
-
function randomFloat(min2, max2) {
|
|
64
|
-
return Math.random() * (max2 - min2) + min2;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// src/math/percentage.ts
|
|
68
|
-
function percentage(value, total) {
|
|
69
|
-
if (total === 0) return 0;
|
|
70
|
-
return value / total * 100;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// src/math/min.ts
|
|
74
|
-
function min(numbers) {
|
|
75
|
-
if (numbers.length === 0) return void 0;
|
|
76
|
-
let result = numbers[0];
|
|
77
|
-
for (let i = 1; i < numbers.length; i++) {
|
|
78
|
-
if (numbers[i] < result) {
|
|
79
|
-
result = numbers[i];
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return result;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// src/math/max.ts
|
|
86
|
-
function max(numbers) {
|
|
87
|
-
if (numbers.length === 0) return void 0;
|
|
88
|
-
let result = numbers[0];
|
|
89
|
-
for (let i = 1; i < numbers.length; i++) {
|
|
90
|
-
if (numbers[i] > result) {
|
|
91
|
-
result = numbers[i];
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return result;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
exports.average = average;
|
|
98
|
-
exports.math_exports = math_exports;
|
|
99
|
-
exports.max = max;
|
|
100
|
-
exports.median = median;
|
|
101
|
-
exports.min = min;
|
|
102
|
-
exports.percentage = percentage;
|
|
103
|
-
exports.randomFloat = randomFloat;
|
|
104
|
-
exports.randomInt = randomInt;
|
|
105
|
-
exports.round = round;
|
|
106
|
-
exports.sum = sum;
|
|
107
|
-
//# sourceMappingURL=chunk-2LJ6NZ6K.js.map
|
|
108
|
-
//# sourceMappingURL=chunk-2LJ6NZ6K.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/math/index.ts","../src/math/sum.ts","../src/math/average.ts","../src/math/median.ts","../src/math/round.ts","../src/math/randomInt.ts","../src/math/randomFloat.ts","../src/math/percentage.ts","../src/math/min.ts","../src/math/max.ts"],"names":["__export","min","max"],"mappings":"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","file":"chunk-2LJ6NZ6K.js","sourcesContent":["export { sum } from './sum'\nexport { average } from './average'\nexport { median } from './median'\nexport { round } from './round'\nexport { randomInt } from './randomInt'\nexport { randomFloat } from './randomFloat'\nexport { percentage } from './percentage'\nexport { min } from './min'\nexport { max } from './max'\n","/**\n * Returns the sum of all numbers in an array.\n *\n * @example\n * sum([1, 2, 3, 4, 5]) // 15\n * sum([]) // 0\n */\nexport function sum(numbers: readonly number[]): number {\n let total = 0\n for (const n of numbers) {\n total += n\n }\n return total\n}\n","/**\n * Returns the average (mean) of all numbers in an array.\n *\n * @example\n * average([1, 2, 3, 4, 5]) // 3\n * average([10, 20]) // 15\n * average([]) // NaN\n */\nexport function average(numbers: readonly number[]): number {\n if (numbers.length === 0) return NaN\n let total = 0\n for (const n of numbers) {\n total += n\n }\n return total / numbers.length\n}\n","/**\n * Returns the median of all numbers in an array.\n *\n * @example\n * median([1, 2, 3, 4, 5]) // 3\n * median([1, 2, 3, 4]) // 2.5\n * median([]) // NaN\n */\nexport function median(numbers: readonly number[]): number {\n if (numbers.length === 0) return NaN\n\n const sorted = [...numbers].sort((a, b) => a - b)\n const mid = Math.floor(sorted.length / 2)\n\n if (sorted.length % 2 === 0) {\n return (sorted[mid - 1]! + sorted[mid]!) / 2\n }\n\n return sorted[mid]!\n}\n","/**\n * Rounds a number to a specified precision.\n *\n * @example\n * round(3.14159, 2) // 3.14\n * round(3.5) // 4\n * round(1234.5, -2) // 1200\n */\nexport function round(num: number, precision: number = 0): number {\n const factor = Math.pow(10, precision)\n return Math.round(num * factor) / factor\n}\n","/**\n * Returns a random integer between min and max (inclusive).\n *\n * @example\n * randomInt(1, 10) // Random integer from 1 to 10\n * randomInt(0, 100) // Random integer from 0 to 100\n */\nexport function randomInt(min: number, max: number): number {\n min = Math.ceil(min)\n max = Math.floor(max)\n return Math.floor(Math.random() * (max - min + 1)) + min\n}\n","/**\n * Returns a random float between min and max.\n *\n * @example\n * randomFloat(0, 1) // Random float from 0 to 1\n * randomFloat(1.5, 3.5) // Random float from 1.5 to 3.5\n */\nexport function randomFloat(min: number, max: number): number {\n return Math.random() * (max - min) + min\n}\n","/**\n * Calculates the percentage of a value relative to a total.\n *\n * @example\n * percentage(25, 100) // 25\n * percentage(1, 4) // 25\n * percentage(0, 100) // 0\n */\nexport function percentage(value: number, total: number): number {\n if (total === 0) return 0\n return (value / total) * 100\n}\n","/**\n * Returns the minimum value in an array.\n *\n * @example\n * min([3, 1, 4, 1, 5]) // 1\n * min([]) // undefined\n */\nexport function min(numbers: readonly number[]): number | undefined {\n if (numbers.length === 0) return undefined\n let result = numbers[0]!\n for (let i = 1; i < numbers.length; i++) {\n if (numbers[i]! < result) {\n result = numbers[i]!\n }\n }\n return result\n}\n","/**\n * Returns the maximum value in an array.\n *\n * @example\n * max([3, 1, 4, 1, 5]) // 5\n * max([]) // undefined\n */\nexport function max(numbers: readonly number[]): number | undefined {\n if (numbers.length === 0) return undefined\n let result = numbers[0]!\n for (let i = 1; i < numbers.length; i++) {\n if (numbers[i]! > result) {\n result = numbers[i]!\n }\n }\n return result\n}\n"]}
|