@kizmann/pico-js 0.5.5 → 1.0.1

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/docs/style.css DELETED
@@ -1,41 +0,0 @@
1
-
2
- * {
3
- outline: none;
4
- }
5
-
6
- html, body {
7
- -webkit-font-smoothing: subpixel-antialiased;
8
- -moz-osx-font-smoothing: grayscale;
9
- font-size: 15px;
10
- font-variant-numeric: normal;
11
- font-feature-settings: normal;
12
- }
13
-
14
- body {
15
- font-size: 14px;
16
- min-height: 100vh;
17
- }
18
-
19
- #app {
20
- max-width: 1024px;
21
- width: 100%;
22
- margin: 0 auto;
23
- padding: 30px;
24
- }
25
-
26
- pre {
27
- font-family: 'Fira Code', monospace;
28
- }
29
-
30
- .n-inverse pre {
31
- color: #fff;
32
- }
33
-
34
- #app > .n-form {
35
- border-radius: 4px;
36
- padding: 30px;
37
- }
38
-
39
- .n-inverse {
40
- background: #32383e;
41
- }
@@ -1,427 +0,0 @@
1
- # Any Utility
2
-
3
- The `Any` class provides a wide range of utility functions for various data type checks, conversions, and operations such as debounce and throttle. This class is part of a larger utility library and can be imported as shown below.
4
-
5
- Here is a list of all headlines with anchor links:
6
-
7
- - [isEmpty](#isempty)
8
- - [isNull](#isnull)
9
- - [isEqual](#isequal)
10
- - [isString](#isstring)
11
- - [isNumber](#isnumber)
12
- - [isBool](#isbool)
13
- - [isFunction](#isfunction)
14
- - [isObject](#isobject)
15
- - [isPlain](#isplain)
16
- - [isArray](#isarray)
17
- - [isDate](#isdate)
18
- - [string](#string)
19
- - [convertString](#convertstring)
20
- - [integer](#integer)
21
- - [float](#float)
22
- - [bool](#bool)
23
- - [boolean](#boolean)
24
- - [convertBool](#convertbool)
25
- - [convertBoolean](#convertboolean)
26
- - [convertDatetime](#convertdatetime)
27
- - [vals](#vals)
28
- - [keys](#keys)
29
- - [async](#async)
30
- - [delay](#delay)
31
- - [debounce](#debounce)
32
- - [throttle](#throttle)
33
- - [framerate](#framerate)
34
- - [form](#form)
35
-
36
- You can click on any of these links to navigate to the respective section in the documentation.
37
-
38
- ## Import
39
-
40
- ```javascript
41
- import { Any } from "../index.js";
42
- ```
43
-
44
- ## Methods
45
-
46
- ### [isEmpty](#isempty)
47
-
48
- Checks if a value is empty.
49
-
50
- - **Parameters**:
51
- - `val`: The value to check.
52
- - **Returns**: `true` if the value is empty, `false` otherwise.
53
-
54
- ```javascript
55
- Any.isEmpty(''); // true
56
- Any.isEmpty([]); // true
57
- Any.isEmpty({}); // true
58
- Any.isEmpty(0); // false
59
- ```
60
-
61
- ### [isNull](#isnull)
62
-
63
- Checks if a value is `null`.
64
-
65
- - **Parameters**:
66
- - `val`: The value to check.
67
- - **Returns**: `true` if the value is `null`, `false` otherwise.
68
-
69
- ```javascript
70
- Any.isNull(null); // true
71
- Any.isNull(undefined); // false
72
- ```
73
-
74
- ### [isEqual](#isequal)
75
-
76
- Checks if two values are equal.
77
-
78
- - **Parameters**:
79
- - `obj`: The first value.
80
- - `val`: The second value.
81
- - **Returns**: `true` if the values are equal, `false` otherwise.
82
-
83
- ```javascript
84
- Any.isEqual(1, '1'); // false
85
- Any.isEqual({a: 1}, {a: 1}); // true
86
- ```
87
-
88
- ### [isString](#isstring)
89
-
90
- Checks if a value is a string.
91
-
92
- - **Parameters**:
93
- - `val`: The value to check.
94
- - **Returns**: `true` if the value is a string, `false` otherwise.
95
-
96
- ```javascript
97
- Any.isString('hello'); // true
98
- Any.isString(123); // false
99
- ```
100
-
101
- ### [isNumber](#isnumber)
102
-
103
- Checks if a value is a number or a numeric string.
104
-
105
- - **Parameters**:
106
- - `val`: The value to check.
107
- - **Returns**: `true` if the value is a number or numeric string, `false` otherwise.
108
-
109
- ```javascript
110
- Any.isNumber(123); // true
111
- Any.isNumber('123'); // true
112
- Any.isNumber('abc'); // false
113
- ```
114
-
115
- ### [isBool](#isbool)
116
-
117
- Checks if a value is a boolean or a boolean string.
118
-
119
- - **Parameters**:
120
- - `val`: The value to check.
121
- - **Returns**: `true` if the value is a boolean or boolean string, `false` otherwise.
122
-
123
- ```javascript
124
- Any.isBool(true); // true
125
- Any.isBool('false'); // true
126
- Any.isBool('yes'); // false
127
- ```
128
-
129
- ### [isFunction](#isfunction)
130
-
131
- Checks if a value is a function.
132
-
133
- - **Parameters**:
134
- - `val`: The value to check.
135
- - **Returns**: `true` if the value is a function, `false` otherwise.
136
-
137
- ```javascript
138
- Any.isFunction(function() {}); // true
139
- Any.isFunction(() => {}); // true
140
- ```
141
-
142
- ### [isObject](#isobject)
143
-
144
- Checks if a value is an object.
145
-
146
- - **Parameters**:
147
- - `val`: The value to check.
148
- - **Returns**: `true` if the value is an object, `false` otherwise.
149
-
150
- ```javascript
151
- Any.isObject({}); // true
152
- Any.isObject(null); // false
153
- ```
154
-
155
- ### [isPlain](#isplain)
156
-
157
- Checks if a value is a plain object.
158
-
159
- - **Parameters**:
160
- - `val`: The value to check.
161
- - **Returns**: `true` if the value is a plain object, `false` otherwise.
162
-
163
- ```javascript
164
- Any.isPlain({}); // true
165
- Any.isPlain(new Date()); // false
166
- ```
167
-
168
- ### [isArray](#isarray)
169
-
170
- Checks if a value is an array.
171
-
172
- - **Parameters**:
173
- - `val`: The value to check.
174
- - **Returns**: `true` if the value is an array, `false` otherwise.
175
-
176
- ```javascript
177
- Any.isArray([]); // true
178
- Any.isArray({}); // false
179
- ```
180
-
181
- ### [isDate](#isdate)
182
-
183
- Checks if a value is a `Date` object.
184
-
185
- - **Parameters**:
186
- - `val`: The value to check.
187
- - **Returns**: `true` if the value is a `Date` object, `false` otherwise.
188
-
189
- ```javascript
190
- Any.isDate(new Date()); // true
191
- Any.isDate('2021-01-01'); // false
192
- ```
193
-
194
- ### [string](#string)
195
-
196
- Converts a value to a string.
197
-
198
- - **Parameters**:
199
- - `val`: The value to convert.
200
- - **Returns**: The value as a string.
201
-
202
- ```javascript
203
- Any.string(123); // '123'
204
- ```
205
-
206
- ### [convertString](#convertstring)
207
-
208
- Converts a value to a string or returns a default string if the value is empty.
209
-
210
- - **Parameters**:
211
- - `val`: The value to convert.
212
- - `empty`: The default string if the value is empty (default is `'-'`).
213
- - **Returns**: The value as a string or the default string if empty.
214
-
215
- ```javascript
216
- Any.convertString(123); // '123'
217
- Any.convertString('', '-'); // '-'
218
- ```
219
-
220
- ### [integer](#integer)
221
-
222
- Converts a value to an integer.
223
-
224
- - **Parameters**:
225
- - `val`: The value to convert.
226
- - **Returns**: The value as an integer.
227
-
228
- ```javascript
229
- Any.integer('123'); // 123
230
- ```
231
-
232
- ### [float](#float)
233
-
234
- Converts a value to a float.
235
-
236
- - **Parameters**:
237
- - `val`: The value to convert.
238
- - **Returns**: The value as a float.
239
-
240
- ```javascript
241
- Any.float('123.45'); // 123.45
242
- ```
243
-
244
- ### [bool](#bool)
245
-
246
- Converts a value to a boolean.
247
-
248
- - **Parameters**:
249
- - `val`: The value to convert.
250
- - **Returns**: The value as a boolean.
251
-
252
- ```javascript
253
- Any.bool('true'); // true
254
- Any.bool(0); // false
255
- ```
256
-
257
- ### [boolean](#boolean)
258
-
259
- Alias for `bool`.
260
-
261
- - **Parameters**:
262
- - `val`: The value to convert.
263
- - **Returns**: The value as a boolean.
264
-
265
- ```javascript
266
- Any.boolean('yes'); // true
267
- Any.boolean('no'); // false
268
- ```
269
-
270
- ### [convertBool](#convertbool)
271
-
272
- Converts a value to a boolean string representation.
273
-
274
- - **Parameters**:
275
- - `val`: The value to convert.
276
- - `yes`: The string to return if the value is truthy (default is `'Yes'`).
277
- - `no`: The string to return if the value is falsy (default is `'No'`).
278
- - **Returns**: The string representation of the boolean value.
279
-
280
- ```javascript
281
- Any.convertBool(true); // 'Yes'
282
- Any.convertBool(false); // 'No'
283
- ```
284
-
285
- ### [convertBoolean](#convertboolean)
286
-
287
- Alias for `convertBool`.
288
-
289
- - **Parameters**:
290
- - `val`: The value to convert.
291
- - `yes`: The string to return if the value is truthy (default is `'Yes'`).
292
- - `no`: The string to return if the value is falsy (default is `'No'`).
293
- - **Returns**: The string representation of the boolean value.
294
-
295
- ```javascript
296
- Any.convertBoolean('1'); // 'Yes'
297
- Any.convertBoolean('0'); // 'No'
298
- ```
299
-
300
- ### [convertDatetime](#convertdatetime)
301
-
302
- Converts a value to a formatted datetime string.
303
-
304
- - **Parameters**:
305
- - `val`: The value to convert.
306
- - `format`: The datetime format (default is `'YYYY-MM-DD hh:mm:ss'`).
307
- - `empty`: The default string if the value is empty (default is `'-'`).
308
- - **Returns**: The formatted datetime string or the default string if empty.
309
-
310
- ```javascript
311
- Any.convertDatetime(new Date(), 'MM/DD/YYYY'); // '05/28/2024'
312
- ```
313
-
314
- ### [vals](#vals)
315
-
316
- Gets the values of an object.
317
-
318
- - **Parameters**:
319
- - `obj`: The object to get values from.
320
- - **Returns**: An array of the object's values.
321
-
322
- ```javascript
323
- Any.vals({a: 1, b: 2}); // [1, 2]
324
- ```
325
-
326
- ### [keys](#keys)
327
-
328
- Gets the keys of an object.
329
-
330
- - **Parameters**:
331
- - `obj`: The object to get keys from.
332
- - **Returns**: An array of the object's keys.
333
-
334
- ```javascript
335
- Any.keys({a: 1, b: 2}); // ['a', 'b']
336
- ```
337
-
338
- ### [async](#async)
339
-
340
- Executes a callback asynchronously.
341
-
342
- - **Parameters**:
343
- - `callback`: The callback function.
344
- - `...args`: The arguments to pass to the callback.
345
- - **Returns**: The `Any` class.
346
-
347
- ```javascript
348
- Any.async(() => console.log('Async call'));
349
- ```
350
-
351
- ### [delay](#delay)
352
-
353
- Executes a callback after a delay.
354
-
355
- - **Parameters**:
356
- - `callback`: The callback function.
357
- - `delay`: The delay in milliseconds (default is `100`).
358
- - `...args`: The arguments to pass to the callback.
359
- - **Returns**: The `Any` class.
360
-
361
- ```javascript
362
- Any.delay(() => console.log('Delayed call'), 500);
363
- ```
364
-
365
- ### [debounce](#debounce)
366
-
367
- Creates a debounced function that delays invoking the callback
368
-
369
- until after the specified delay.
370
-
371
- - **Parameters**:
372
- - `callback`: The callback function.
373
- - `delay`: The delay in milliseconds (default is `100`).
374
- - `ref`: Optional reference to store the debounce timer.
375
- - **Returns**: A debounced function.
376
-
377
- ```javascript
378
- const debouncedFn = Any.debounce(() => console.log('Debounced call'), 300);
379
- debouncedFn();
380
- ```
381
-
382
- ### [throttle](#throttle)
383
-
384
- Creates a throttled function that only invokes the callback at most once per every specified delay.
385
-
386
- - **Parameters**:
387
- - `callback`: The callback function.
388
- - `delay`: The delay in milliseconds (default is `100`).
389
- - `ref`: Optional reference to store the throttle state.
390
- - **Returns**: A throttled function.
391
-
392
- ```javascript
393
- const throttledFn = Any.throttle(() => console.log('Throttled call'), 300);
394
- throttledFn();
395
- ```
396
-
397
- ### [framerate](#framerate)
398
-
399
- Creates a function that invokes the callback at a specified frame rate.
400
-
401
- - **Parameters**:
402
- - `callback`: The callback function.
403
- - `rate`: The frame rate in frames per second (default is `30`).
404
- - `ref`: Optional reference to store the last invocation time.
405
- - **Returns**: A function that enforces the specified frame rate.
406
-
407
- ```javascript
408
- const frameRateFn = Any.framerate(() => console.log('Frame rate call'), 60);
409
- frameRateFn();
410
- ```
411
-
412
- ### [form](#form)
413
-
414
- Creates a `FormData` object from a plain object.
415
-
416
- - **Parameters**:
417
- - `obj`: The plain object to convert.
418
- - **Returns**: A `FormData` object.
419
-
420
- ```javascript
421
- const formData = Any.form({a: 1, b: 2});
422
- ```
423
-
424
- ## License
425
-
426
- This documentation is based on the source code of the `Any` class. The `Any` class is part of a utility library. Please refer to the library's license for more information.
427
- ```
package/mix-manifest.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "/dist/js/index.js": "/dist/js/index.js",
3
- "/dist/css/pico-ui.css": "/dist/css/pico-ui.css"
4
- }
package/pico.svg DELETED
@@ -1,52 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!-- Generator: Adobe Illustrator 25.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
- viewBox="0 0 300 120" style="enable-background:new 0 0 300 120;" xml:space="preserve">
5
- <style type="text/css">
6
- .st0{fill:url(#SVGID_1_);}
7
- .st1{fill:url(#SVGID_2_);}
8
- .st2{fill:url(#SVGID_3_);}
9
- .st3{fill:url(#SVGID_4_);}
10
- </style>
11
- <g>
12
- <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="262.8699" y1="12.8418" x2="223.9448" y2="71.4924">
13
- <stop offset="0" style="stop-color:#00E99E"/>
14
- <stop offset="1" style="stop-color:#008E9E"/>
15
- </linearGradient>
16
- <path class="st0" d="M234.7347,46.9182v12.3925c14.9295,0,27.1537-11.7949,27.8493-26.5553h11.541V20.363h-11.5073v-8.3028
17
- h-12.3925v8.3028H233.407v12.3925h16.7511C249.481,40.6764,242.8279,46.9182,234.7347,46.9182z"/>
18
- <linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="284.4135" y1="27.1398" x2="245.4884" y2="85.7904">
19
- <stop offset="0" style="stop-color:#00E99E"/>
20
- <stop offset="1" style="stop-color:#008E9E"/>
21
- </linearGradient>
22
- <path class="st1" d="M271.2327,52.429c-7.3978,12.9807-21.2537,21.0445-36.1617,21.0445V85.866
23
- c19.3494,0,37.3313-10.4609,46.929-27.3008L271.2327,52.429z"/>
24
- </g>
25
- <g>
26
- <path d="M50.5869,39.8896c2.7451-1.4746,5.8828-2.2119,9.4102-2.2119c4.1045,0,7.8184,1.0122,11.1436,3.0356
27
- c3.3242,2.0249,5.9551,4.8999,7.8926,8.6294c1.9365,3.7295,2.9053,8.0518,2.9053,12.9658c0,4.915-0.9688,9.2656-2.9053,13.0518
28
- c-1.9375,3.7881-4.5684,6.7217-7.8926,8.8027c-3.3252,2.082-7.0391,3.1221-11.1436,3.1221c-3.5273,0-6.6348-0.7236-9.3232-2.168
29
- s-4.8721-3.2656-6.5479-5.4639v29.7471H31.9844V38.4585H44.126v6.938C45.6865,43.2002,47.8398,41.3633,50.5869,39.8896z
30
- M67.7588,54.8066c-1.1855-2.1104-2.7471-3.7148-4.6836-4.8135c-1.9375-1.0977-4.0322-1.6475-6.2871-1.6475
31
- c-2.1982,0-4.2646,0.5635-6.2012,1.6904c-1.9375,1.1279-3.499,2.7617-4.6836,4.9004c-1.1855,2.1396-1.7773,4.6543-1.7773,7.5449
32
- c0,2.8916,0.5918,5.4072,1.7773,7.5459c1.1846,2.1396,2.7461,3.7725,4.6836,4.8994c1.9365,1.1279,4.0029,1.6914,6.2012,1.6914
33
- c2.2549,0,4.3496-0.5771,6.2871-1.7344c1.9365-1.1562,3.498-2.8037,4.6836-4.9434c1.1846-2.1387,1.7783-4.6836,1.7783-7.6318
34
- C69.5371,59.418,68.9434,56.918,67.7588,54.8066z"/>
35
- <path d="M102.9258,38.4585v48.0464H90.7842V38.4585H102.9258z"/>
36
- <path d="M114.8076,49.4297c2.0234-3.7295,4.8271-6.6201,8.4121-8.6729c3.585-2.0518,7.6895-3.0791,12.3154-3.0791
37
- c5.9541,0,10.8838,1.4893,14.7871,4.4668c3.9023,2.9785,6.5176,7.1543,7.8486,12.5322h-13.0957
38
- c-0.6943-2.082-1.8643-3.7148-3.5127-4.9004c-1.6475-1.1846-3.6855-1.7783-6.1143-1.7783c-3.4688,0-6.2158,1.2578-8.2393,3.7725
39
- c-2.0244,2.5156-3.0352,6.0859-3.0352,10.7109c0,4.5684,1.0107,8.1094,3.0352,10.624c2.0234,2.5156,4.7705,3.7725,8.2393,3.7725
40
- c4.9141,0,8.123-2.1963,9.627-6.5908h13.0957c-1.3311,5.2031-3.9609,9.3379-7.8926,12.4014
41
- c-3.9326,3.0654-8.8457,4.5967-14.7432,4.5967c-4.626,0-8.7305-1.0254-12.3154-3.0781c-3.585-2.0518-6.3887-4.9434-8.4121-8.6729
42
- c-2.0244-3.7295-3.0352-8.0791-3.0352-13.0527C111.7725,57.5098,112.7832,53.1582,114.8076,49.4297z"/>
43
- <path d="M175.9482,84.207c-3.7002-2.0518-6.6064-4.957-8.7158-8.7168c-2.1113-3.7568-3.166-8.0938-3.166-13.0088
44
- c0-4.9131,1.085-9.25,3.2529-13.0088c2.168-3.7578,5.1299-6.6631,8.8896-8.7158c3.7568-2.0518,7.9482-3.0791,12.5752-3.0791
45
- c4.625,0,8.8164,1.0273,12.5752,3.0791c3.7578,2.0527,6.7207,4.958,8.8896,8.7158c2.168,3.7588,3.252,8.0957,3.252,13.0088
46
- c0,4.915-1.1143,9.252-3.3389,13.0088c-2.2266,3.7598-5.2334,6.665-9.0195,8.7168c-3.7881,2.0527-8.0225,3.0781-12.7061,3.0781
47
- C183.8105,87.2852,179.6475,86.2598,175.9482,84.207z M194.6377,75.1006c1.9365-1.0693,3.4824-2.6738,4.6396-4.8135
48
- c1.1562-2.1387,1.7354-4.7402,1.7354-7.8057c0-4.5664-1.2012-8.0791-3.5996-10.5371c-2.3994-2.457-5.334-3.6855-8.8027-3.6855
49
- s-6.374,1.2285-8.7158,3.6855c-2.3418,2.458-3.5127,5.9707-3.5127,10.5371c0,4.5684,1.1416,8.0811,3.4258,10.5371
50
- c2.2832,2.459,5.1602,3.6865,8.6289,3.6865C190.6338,76.7051,192.7002,76.1709,194.6377,75.1006z"/>
51
- </g>
52
- </svg>
package/tsconfig.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "baseUrl": ".",
4
- "paths": {
5
- "*": [
6
- "types/*"
7
- ]
8
- },
9
- "typeRoots": [
10
- "./node_modules/@types",
11
- "./types"
12
- ]
13
- }
14
- }
package/types/index.d.ts DELETED
@@ -1,25 +0,0 @@
1
- // types/index.d.ts
2
- import { Arr } from "./utility/array";
3
- import { Obj } from "./utility/object";
4
- import { Any } from "./utility/any";
5
- import { Num } from "./utility/number";
6
- import { Str } from "./utility/string";
7
- import { Now } from "./utility/now";
8
-
9
- export declare module "@kizmann/pico-js" {
10
-
11
- const Arr: Arr;
12
- const Obj: Obj;
13
- const Any: Any;
14
- const Str: Str;
15
- const Num: Num;
16
- const Now: Now;
17
-
18
- export {
19
- Arr, Obj, Any, Str, Num, Now
20
- };
21
-
22
- export default {
23
- Arr, Obj, Any, Str, Num, Now
24
- };
25
- }
@@ -1,66 +0,0 @@
1
- // types/utility/any.d.ts
2
-
3
-
4
- import { Arr } from "./array";
5
- import { Obj } from "./object";
6
- import { Now } from "./now";
7
-
8
- declare class Any {
9
- static isEmpty(val : any) : boolean;
10
-
11
- static isNull(val : any) : boolean;
12
-
13
- static isEqual(obj : any, val : any) : boolean;
14
-
15
- static isString(val : any) : boolean;
16
-
17
- static isNumber(val : any) : boolean;
18
-
19
- static isBool(val : any) : boolean;
20
-
21
- static isFunction(val : any) : boolean;
22
-
23
- static isObject(val : any) : boolean;
24
-
25
- static isPlain(val : any) : boolean;
26
-
27
- static isArray(val : any) : boolean;
28
-
29
- static isDate(val : any) : boolean;
30
-
31
- static string(val : any) : string;
32
-
33
- static convertString(val : any, empty? : string) : string;
34
-
35
- static integer(val : any) : number;
36
-
37
- static float(val : any) : number;
38
-
39
- static bool(val : any) : boolean;
40
-
41
- static boolean(val : any) : boolean;
42
-
43
- static convertBool(val : any, yes? : string, no? : string) : string;
44
-
45
- static convertBoolean(val : any, yes? : string, no? : string) : string;
46
-
47
- static convertDatetime(val : any, format? : string, empty? : string) : string;
48
-
49
- static vals(obj : any) : any[];
50
-
51
- static keys(obj : any) : string[];
52
-
53
- static async(callback : (...args : any[]) => void, ...args : any[]) : Any;
54
-
55
- static delay(callback : (...args : any[]) => void, delay? : number, ...args : any[]) : Any;
56
-
57
- static debounce(callback : (...args : any[]) => void, delay? : number, ref? : any) : (...args : any[]) => void;
58
-
59
- static throttle(callback : (...args : any[]) => void, delay? : number, ref? : any) : (...args : any[]) => void;
60
-
61
- static framerate(callback : (...args : any[]) => void, rate? : number, ref? : any) : (...args : any[]) => void;
62
-
63
- static form(obj : any) : FormData;
64
- }
65
-
66
- export default Any;
@@ -1,46 +0,0 @@
1
- // types/utility/array.d.ts
2
-
3
- declare class Arr {
4
- static make(count: number): number[];
5
- static all<T>(arr: T | T[]): T[];
6
- static get<T>(arr: T[], index: number, fallback?: T): T;
7
- static set<T>(arr: T[], index: number, value: T): T;
8
- static first<T>(arr: T[], fallback?: T): T;
9
- static second<T>(arr: T[], fallback?: T): T;
10
- static third<T>(arr: T[], fallback?: T): T;
11
- static last<T>(arr: T[], fallback?: T): T;
12
- static prepend<T>(arr: T[], val: T): T[];
13
- static append<T>(arr: T[], val: T): T[];
14
- static sort<T>(obj: AnyObject, key: string | ((a: T, b: T) => number)): T[];
15
- static sortString<T>(obj: AnyObject, key: string): T[];
16
- static filter<T>(arr: T[], filter: any): T[];
17
- static filterIndex(arr: any[], filter: any): number[];
18
- static find<T>(arr: T[], val: any, fallback?: T): T;
19
- static findIndex(arr: any[], val: any, fallback?: number): number;
20
- static has<T>(arr: T[], val: any): boolean;
21
- static add<T>(arr: T[], val: T, finder?: any): T[];
22
- static replace<T>(arr: T[], val: T, finder?: any): T[];
23
- static remove<T>(arr: T[], val: any): T[];
24
- static toggle<T>(arr: T[], val: T): T[];
25
- static removeIndex<T>(arr: T[], val: number): T[];
26
- static insert<T>(arr: T[], key: number, val: T): T[];
27
- static slice<T>(arr: T[], key: number, count?: number): T[];
28
- static splice<T>(arr: T[], key: number, count?: number): T[];
29
- static equal<T>(arr1: T[], arr2: T[]): boolean;
30
- static includes<T>(arr: T[], val: T): boolean;
31
- static contains<T>(arr: T[], val: T[]): boolean;
32
- static concat<T>(arr: T[], ...args: T[]): T[];
33
- static clone<T>(arr: T[]): T[];
34
- static merge<T>(arr: T[], ...args: T[]): T[];
35
- static push<T>(arr: T[], ...args: T[]): T[];
36
- static diff<T>(arr: T[], val: T[]): T[];
37
- static intersect<T>(...args: T[][]): T[];
38
- static chunk<T>(arr: T[], chunk?: number): T[][];
39
- static reduce<T, U>(arr: T[], callback: (accumulator: U, currentValue: T, currentIndex: number, array: T[]) => U, accumulator: U): U;
40
- static extract<T>(arr: T[], path: string): any[];
41
- static each<T>(arr: T[], callback: (val: T, key: number | string) => any): any[];
42
- static map<T>(arr: T[], callback: (val: T, key: number | string) => any): T[];
43
- static recursive<T>(arr: T[], key: string, callback: (val: any, cascade: any[]) => any, cascade?: any[]): T[];
44
- }
45
-
46
- export default Arr;