@valkyriestudios/utils 12.4.0 → 12.5.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/README.md +9 -1
- package/array/index.d.ts +10 -0
- package/array/index.js +25 -0
- package/boolean/index.d.ts +2 -0
- package/boolean/index.js +6 -0
- package/caching/index.d.ts +2 -0
- package/caching/index.js +5 -0
- package/date/index.d.ts +11 -0
- package/date/index.js +24 -0
- package/deep/index.d.ts +5 -0
- package/deep/index.js +15 -0
- package/formdata/index.d.ts +2 -0
- package/formdata/index.js +6 -0
- package/formdata/is.d.ts +9 -0
- package/formdata/is.js +8 -0
- package/function/index.d.ts +7 -0
- package/function/index.js +19 -0
- package/hash/index.d.ts +3 -0
- package/hash/index.js +7 -0
- package/index.d.ts +326 -236
- package/is.d.ts +50 -64
- package/is.js +57 -71
- package/number/index.d.ts +18 -0
- package/number/index.js +57 -0
- package/object/index.d.ts +6 -0
- package/object/index.js +17 -0
- package/package.json +1 -1
- package/regexp/index.d.ts +3 -0
- package/regexp/index.js +9 -0
- package/string/index.d.ts +7 -0
- package/string/index.js +20 -0
package/README.md
CHANGED
|
@@ -278,7 +278,7 @@ const memoized_function = memoize((a) => {
|
|
|
278
278
|
- **isDate(val:any)**
|
|
279
279
|
Check if a variable is of type Date
|
|
280
280
|
```js
|
|
281
|
-
isDate(new Date('December 17, 1995 03:24:00'); // TRUE
|
|
281
|
+
isDate(new Date('December 17, 1995 03:24:00')); // TRUE
|
|
282
282
|
isDate('December 17, 1995 03:24:00'); // FALSE
|
|
283
283
|
```
|
|
284
284
|
|
|
@@ -545,6 +545,14 @@ An empty function that returns a promise that will immediately resolve itself an
|
|
|
545
545
|
An empty function that returns a promise that will resolve after X milliseconds, default is set to 1000ms.
|
|
546
546
|
**
|
|
547
547
|
|
|
548
|
+
### formdata
|
|
549
|
+
- **isFormData(val:any)**
|
|
550
|
+
Check if a variable is of type FormData
|
|
551
|
+
```js
|
|
552
|
+
isFormData(new FormData()); // TRUE
|
|
553
|
+
isFormData({hi: 'there'}); // FALSE
|
|
554
|
+
```
|
|
555
|
+
|
|
548
556
|
### hash
|
|
549
557
|
- **guid()**
|
|
550
558
|
Generate a unique identifier (guid) according to RFC4122
|
package/array/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { dedupe } from './dedupe';
|
|
2
|
+
import { isArray } from './is';
|
|
3
|
+
import { isNotEmptyArray } from './isNotEmpty';
|
|
4
|
+
import { join } from './join';
|
|
5
|
+
import { mapFn } from './mapFn';
|
|
6
|
+
import { mapKey } from './mapKey';
|
|
7
|
+
import { mapPrimitive } from './mapPrimitive';
|
|
8
|
+
import { shuffle } from './shuffle';
|
|
9
|
+
import { sort } from './sort';
|
|
10
|
+
export { dedupe, isArray, isArray as is, isNotEmptyArray, isNotEmptyArray as isNotEmpty, isNotEmptyArray as isNeArray, isNotEmptyArray as isNe, join, mapFn, mapKey, mapPrimitive, shuffle, sort };
|
package/array/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sort = exports.shuffle = exports.mapPrimitive = exports.mapKey = exports.mapFn = exports.join = exports.isNe = exports.isNeArray = exports.isNotEmpty = exports.isNotEmptyArray = exports.is = exports.isArray = exports.dedupe = void 0;
|
|
4
|
+
const dedupe_1 = require("./dedupe");
|
|
5
|
+
Object.defineProperty(exports, "dedupe", { enumerable: true, get: function () { return dedupe_1.dedupe; } });
|
|
6
|
+
const is_1 = require("./is");
|
|
7
|
+
Object.defineProperty(exports, "isArray", { enumerable: true, get: function () { return is_1.isArray; } });
|
|
8
|
+
Object.defineProperty(exports, "is", { enumerable: true, get: function () { return is_1.isArray; } });
|
|
9
|
+
const isNotEmpty_1 = require("./isNotEmpty");
|
|
10
|
+
Object.defineProperty(exports, "isNotEmptyArray", { enumerable: true, get: function () { return isNotEmpty_1.isNotEmptyArray; } });
|
|
11
|
+
Object.defineProperty(exports, "isNotEmpty", { enumerable: true, get: function () { return isNotEmpty_1.isNotEmptyArray; } });
|
|
12
|
+
Object.defineProperty(exports, "isNeArray", { enumerable: true, get: function () { return isNotEmpty_1.isNotEmptyArray; } });
|
|
13
|
+
Object.defineProperty(exports, "isNe", { enumerable: true, get: function () { return isNotEmpty_1.isNotEmptyArray; } });
|
|
14
|
+
const join_1 = require("./join");
|
|
15
|
+
Object.defineProperty(exports, "join", { enumerable: true, get: function () { return join_1.join; } });
|
|
16
|
+
const mapFn_1 = require("./mapFn");
|
|
17
|
+
Object.defineProperty(exports, "mapFn", { enumerable: true, get: function () { return mapFn_1.mapFn; } });
|
|
18
|
+
const mapKey_1 = require("./mapKey");
|
|
19
|
+
Object.defineProperty(exports, "mapKey", { enumerable: true, get: function () { return mapKey_1.mapKey; } });
|
|
20
|
+
const mapPrimitive_1 = require("./mapPrimitive");
|
|
21
|
+
Object.defineProperty(exports, "mapPrimitive", { enumerable: true, get: function () { return mapPrimitive_1.mapPrimitive; } });
|
|
22
|
+
const shuffle_1 = require("./shuffle");
|
|
23
|
+
Object.defineProperty(exports, "shuffle", { enumerable: true, get: function () { return shuffle_1.shuffle; } });
|
|
24
|
+
const sort_1 = require("./sort");
|
|
25
|
+
Object.defineProperty(exports, "sort", { enumerable: true, get: function () { return sort_1.sort; } });
|
package/boolean/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.is = exports.isBoolean = void 0;
|
|
4
|
+
const is_1 = require("./is");
|
|
5
|
+
Object.defineProperty(exports, "isBoolean", { enumerable: true, get: function () { return is_1.isBoolean; } });
|
|
6
|
+
Object.defineProperty(exports, "is", { enumerable: true, get: function () { return is_1.isBoolean; } });
|
package/caching/index.js
ADDED
package/date/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { addUTC } from './addUTC';
|
|
2
|
+
import { diff } from './diff';
|
|
3
|
+
import { endOfUTC } from './endOfUTC';
|
|
4
|
+
import { format } from './format';
|
|
5
|
+
import { isDate } from './is';
|
|
6
|
+
import { nowUnix } from './nowUnix';
|
|
7
|
+
import { nowUnixMs } from './nowUnixMs';
|
|
8
|
+
import { startOfUTC } from './startOfUTC';
|
|
9
|
+
import { toUnix } from './toUnix';
|
|
10
|
+
import { toUTC } from './toUTC';
|
|
11
|
+
export { addUTC, diff, endOfUTC, format, isDate, isDate as is, nowUnix, nowUnixMs, startOfUTC, toUnix, toUTC };
|
package/date/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toUTC = exports.toUnix = exports.startOfUTC = exports.nowUnixMs = exports.nowUnix = exports.is = exports.isDate = exports.format = exports.endOfUTC = exports.diff = exports.addUTC = void 0;
|
|
4
|
+
const addUTC_1 = require("./addUTC");
|
|
5
|
+
Object.defineProperty(exports, "addUTC", { enumerable: true, get: function () { return addUTC_1.addUTC; } });
|
|
6
|
+
const diff_1 = require("./diff");
|
|
7
|
+
Object.defineProperty(exports, "diff", { enumerable: true, get: function () { return diff_1.diff; } });
|
|
8
|
+
const endOfUTC_1 = require("./endOfUTC");
|
|
9
|
+
Object.defineProperty(exports, "endOfUTC", { enumerable: true, get: function () { return endOfUTC_1.endOfUTC; } });
|
|
10
|
+
const format_1 = require("./format");
|
|
11
|
+
Object.defineProperty(exports, "format", { enumerable: true, get: function () { return format_1.format; } });
|
|
12
|
+
const is_1 = require("./is");
|
|
13
|
+
Object.defineProperty(exports, "isDate", { enumerable: true, get: function () { return is_1.isDate; } });
|
|
14
|
+
Object.defineProperty(exports, "is", { enumerable: true, get: function () { return is_1.isDate; } });
|
|
15
|
+
const nowUnix_1 = require("./nowUnix");
|
|
16
|
+
Object.defineProperty(exports, "nowUnix", { enumerable: true, get: function () { return nowUnix_1.nowUnix; } });
|
|
17
|
+
const nowUnixMs_1 = require("./nowUnixMs");
|
|
18
|
+
Object.defineProperty(exports, "nowUnixMs", { enumerable: true, get: function () { return nowUnixMs_1.nowUnixMs; } });
|
|
19
|
+
const startOfUTC_1 = require("./startOfUTC");
|
|
20
|
+
Object.defineProperty(exports, "startOfUTC", { enumerable: true, get: function () { return startOfUTC_1.startOfUTC; } });
|
|
21
|
+
const toUnix_1 = require("./toUnix");
|
|
22
|
+
Object.defineProperty(exports, "toUnix", { enumerable: true, get: function () { return toUnix_1.toUnix; } });
|
|
23
|
+
const toUTC_1 = require("./toUTC");
|
|
24
|
+
Object.defineProperty(exports, "toUTC", { enumerable: true, get: function () { return toUTC_1.toUTC; } });
|
package/deep/index.d.ts
ADDED
package/deep/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deepSet = exports.set = exports.deepSeal = exports.seal = exports.deepGet = exports.get = exports.deepFreeze = exports.freeze = void 0;
|
|
4
|
+
const freeze_1 = require("./freeze");
|
|
5
|
+
Object.defineProperty(exports, "freeze", { enumerable: true, get: function () { return freeze_1.deepFreeze; } });
|
|
6
|
+
Object.defineProperty(exports, "deepFreeze", { enumerable: true, get: function () { return freeze_1.deepFreeze; } });
|
|
7
|
+
const get_1 = require("./get");
|
|
8
|
+
Object.defineProperty(exports, "get", { enumerable: true, get: function () { return get_1.deepGet; } });
|
|
9
|
+
Object.defineProperty(exports, "deepGet", { enumerable: true, get: function () { return get_1.deepGet; } });
|
|
10
|
+
const seal_1 = require("./seal");
|
|
11
|
+
Object.defineProperty(exports, "seal", { enumerable: true, get: function () { return seal_1.deepSeal; } });
|
|
12
|
+
Object.defineProperty(exports, "deepSeal", { enumerable: true, get: function () { return seal_1.deepSeal; } });
|
|
13
|
+
const set_1 = require("./set");
|
|
14
|
+
Object.defineProperty(exports, "set", { enumerable: true, get: function () { return set_1.deepSet; } });
|
|
15
|
+
Object.defineProperty(exports, "deepSet", { enumerable: true, get: function () { return set_1.deepSet; } });
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.is = exports.isFormData = void 0;
|
|
4
|
+
const is_1 = require("./is");
|
|
5
|
+
Object.defineProperty(exports, "isFormData", { enumerable: true, get: function () { return is_1.isFormData; } });
|
|
6
|
+
Object.defineProperty(exports, "is", { enumerable: true, get: function () { return is_1.isFormData; } });
|
package/formdata/is.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check whether or not a provided value is an instance of FormData
|
|
3
|
+
*
|
|
4
|
+
* @param val - Value to verify
|
|
5
|
+
*
|
|
6
|
+
* @returns Whether or not the value is an instance of FormData
|
|
7
|
+
*/
|
|
8
|
+
declare function isFormData(val: unknown): val is FormData;
|
|
9
|
+
export { isFormData, isFormData as default };
|
package/formdata/is.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { isFunction } from './is';
|
|
2
|
+
import { isAsyncFunction } from './isAsync';
|
|
3
|
+
import { noop } from './noop';
|
|
4
|
+
import { noopresolve } from './noopresolve';
|
|
5
|
+
import { noopreturn } from './noopreturn';
|
|
6
|
+
import { sleep } from './sleep';
|
|
7
|
+
export { isFunction, isFunction as is, isFunction as isFn, isAsyncFunction, isAsyncFunction as isAsync, isAsyncFunction as isAsyncFn, noop, noopresolve, noopreturn, sleep };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sleep = exports.noopreturn = exports.noopresolve = exports.noop = exports.isAsyncFn = exports.isAsync = exports.isAsyncFunction = exports.isFn = exports.is = exports.isFunction = void 0;
|
|
4
|
+
const is_1 = require("./is");
|
|
5
|
+
Object.defineProperty(exports, "isFunction", { enumerable: true, get: function () { return is_1.isFunction; } });
|
|
6
|
+
Object.defineProperty(exports, "is", { enumerable: true, get: function () { return is_1.isFunction; } });
|
|
7
|
+
Object.defineProperty(exports, "isFn", { enumerable: true, get: function () { return is_1.isFunction; } });
|
|
8
|
+
const isAsync_1 = require("./isAsync");
|
|
9
|
+
Object.defineProperty(exports, "isAsyncFunction", { enumerable: true, get: function () { return isAsync_1.isAsyncFunction; } });
|
|
10
|
+
Object.defineProperty(exports, "isAsync", { enumerable: true, get: function () { return isAsync_1.isAsyncFunction; } });
|
|
11
|
+
Object.defineProperty(exports, "isAsyncFn", { enumerable: true, get: function () { return isAsync_1.isAsyncFunction; } });
|
|
12
|
+
const noop_1 = require("./noop");
|
|
13
|
+
Object.defineProperty(exports, "noop", { enumerable: true, get: function () { return noop_1.noop; } });
|
|
14
|
+
const noopresolve_1 = require("./noopresolve");
|
|
15
|
+
Object.defineProperty(exports, "noopresolve", { enumerable: true, get: function () { return noopresolve_1.noopresolve; } });
|
|
16
|
+
const noopreturn_1 = require("./noopreturn");
|
|
17
|
+
Object.defineProperty(exports, "noopreturn", { enumerable: true, get: function () { return noopreturn_1.noopreturn; } });
|
|
18
|
+
const sleep_1 = require("./sleep");
|
|
19
|
+
Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { return sleep_1.sleep; } });
|
package/hash/index.d.ts
ADDED
package/hash/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.guid = exports.fnv1A = void 0;
|
|
4
|
+
const fnv1A_1 = require("./fnv1A");
|
|
5
|
+
Object.defineProperty(exports, "fnv1A", { enumerable: true, get: function () { return fnv1A_1.fnv1A; } });
|
|
6
|
+
const guid_1 = require("./guid");
|
|
7
|
+
Object.defineProperty(exports, "guid", { enumerable: true, get: function () { return guid_1.guid; } });
|