vest-utils 0.0.2 → 0.0.3-dev-fcaa09
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/package.json +1 -1
- package/src/bus.ts +1 -1
- package/src/callEach.ts +1 -1
- package/src/invariant.ts +2 -1
- package/src/vest-utils.ts +5 -0
- package/tsconfig.json +39 -1
- package/types/vest-utils.d.ts +7 -0
- package/types/vest-utils.d.ts.map +1 -0
package/package.json
CHANGED
package/src/bus.ts
CHANGED
package/src/callEach.ts
CHANGED
package/src/invariant.ts
CHANGED
package/src/vest-utils.ts
CHANGED
|
@@ -29,3 +29,8 @@ export { isUndefined, isNotUndefined } from 'isUndefined';
|
|
|
29
29
|
export { isArray, isNotArray } from 'isArrayValue';
|
|
30
30
|
export { isEmpty, isNotEmpty } from 'isEmpty';
|
|
31
31
|
export { isPositive } from 'isPositive';
|
|
32
|
+
|
|
33
|
+
export type { DropFirst } from 'utilityTypes';
|
|
34
|
+
export type { Stringable } from 'utilityTypes';
|
|
35
|
+
export type { CB } from 'utilityTypes';
|
|
36
|
+
export type { ValueOf } from 'utilityTypes';
|
package/tsconfig.json
CHANGED
|
@@ -1,8 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "../../tsconfig.json",
|
|
3
|
+
"rootDir": ".",
|
|
3
4
|
"compilerOptions": {
|
|
5
|
+
"baseUrl": ".",
|
|
4
6
|
"declarationMap": true,
|
|
5
7
|
"declarationDir": "./types",
|
|
6
|
-
"outDir": "./dist"
|
|
8
|
+
"outDir": "./dist",
|
|
9
|
+
"paths": {
|
|
10
|
+
"asArray": ["src/asArray.ts"],
|
|
11
|
+
"assign": ["src/assign.ts"],
|
|
12
|
+
"bindNot": ["src/bindNot.ts"],
|
|
13
|
+
"bus": ["src/bus.ts"],
|
|
14
|
+
"cache": ["src/cache.ts"],
|
|
15
|
+
"callEach": ["src/callEach.ts"],
|
|
16
|
+
"defaultTo": ["src/defaultTo.ts"],
|
|
17
|
+
"deferThrow": ["src/deferThrow.ts"],
|
|
18
|
+
"either": ["src/either.ts"],
|
|
19
|
+
"globals.d": ["src/globals.d.ts"],
|
|
20
|
+
"greaterThan": ["src/greaterThan.ts"],
|
|
21
|
+
"hasOwnProperty": ["src/hasOwnProperty.ts"],
|
|
22
|
+
"invariant": ["src/invariant.ts"],
|
|
23
|
+
"isArrayValue": ["src/isArrayValue.ts"],
|
|
24
|
+
"isBooleanValue": ["src/isBooleanValue.ts"],
|
|
25
|
+
"isEmpty": ["src/isEmpty.ts"],
|
|
26
|
+
"isFunction": ["src/isFunction.ts"],
|
|
27
|
+
"isNull": ["src/isNull.ts"],
|
|
28
|
+
"isNullish": ["src/isNullish.ts"],
|
|
29
|
+
"isNumeric": ["src/isNumeric.ts"],
|
|
30
|
+
"isPositive": ["src/isPositive.ts"],
|
|
31
|
+
"isPromise": ["src/isPromise.ts"],
|
|
32
|
+
"isStringValue": ["src/isStringValue.ts"],
|
|
33
|
+
"isUndefined": ["src/isUndefined.ts"],
|
|
34
|
+
"last": ["src/last.ts"],
|
|
35
|
+
"lengthEquals": ["src/lengthEquals.ts"],
|
|
36
|
+
"longerThan": ["src/longerThan.ts"],
|
|
37
|
+
"mapFirst": ["src/mapFirst.ts"],
|
|
38
|
+
"nestedArray": ["src/nestedArray.ts"],
|
|
39
|
+
"numberEquals": ["src/numberEquals.ts"],
|
|
40
|
+
"optionalFunctionValue": ["src/optionalFunctionValue.ts"],
|
|
41
|
+
"seq": ["src/seq.ts"],
|
|
42
|
+
"utilityTypes": ["src/utilityTypes.ts"],
|
|
43
|
+
"vest-utils": ["src/vest-utils.ts"]
|
|
44
|
+
}
|
|
7
45
|
}
|
|
8
46
|
}
|
package/types/vest-utils.d.ts
CHANGED
|
@@ -20,8 +20,13 @@ declare namespace nestedArray {
|
|
|
20
20
|
function getCurrent<T>(array: NestedArray<T>, path: number[]): NestedArray<T>;
|
|
21
21
|
}
|
|
22
22
|
declare function asArray<T>(possibleArg: T | T[]): T[];
|
|
23
|
+
type DropFirst<T extends unknown[]> = T extends [
|
|
24
|
+
unknown,
|
|
25
|
+
...infer U
|
|
26
|
+
] ? U : never;
|
|
23
27
|
type Stringable = string | ((...args: any[]) => string);
|
|
24
28
|
type CB = (...args: any[]) => any;
|
|
29
|
+
type ValueOf<T> = T[keyof T];
|
|
25
30
|
declare function callEach(arr: CB[]): void;
|
|
26
31
|
/**
|
|
27
32
|
* A safe hasOwnProperty access
|
|
@@ -90,3 +95,5 @@ declare function isEmpty(value: unknown): boolean;
|
|
|
90
95
|
declare const isNotEmpty: (value: unknown) => boolean;
|
|
91
96
|
declare function isPositive(value: number | string): boolean;
|
|
92
97
|
export { createCache as cache, isNullish, isNotNullish, nestedArray, asArray, callEach, hasOwnProperty, isPromise, optionalFunctionValue, _default as assign, defaultTo, invariant, StringObject, isStringValue, bindNot, either, isBoolean, last, deferThrow, bus, seq, isFunction, mapFirst, greaterThan, longerThan, isNumeric, isNotNumeric, lengthEquals, lengthNotEquals, numberEquals, numberNotEquals, isNull, isNotNull, isUndefined, isNotUndefined, isArray, isNotArray, isEmpty, isNotEmpty, isPositive };
|
|
98
|
+
export type { DropFirst, Stringable, CB, ValueOf };
|
|
99
|
+
//# sourceMappingURL=vest-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vest-utils.d.ts","sourceRoot":"","sources":["../src/vest-utils.ts","../src/bindNot.ts","../src/isNumeric.ts","../src/numberEquals.ts","../src/lengthEquals.ts","../src/greaterThan.ts","../src/longerThan.ts","../src/cache.ts","../src/isNull.ts","../src/isUndefined.ts","../src/isNullish.ts","../src/asArray.ts","../src/isFunction.ts","../src/optionalFunctionValue.ts","../src/defaultTo.ts","../src/isArrayValue.ts","../src/last.ts","../src/nestedArray.ts","../src/utilityTypes.ts","../src/callEach.ts","../src/hasOwnProperty.ts","../src/isPromise.ts","../src/assign.ts","../src/invariant.ts","../src/isStringValue.ts","../src/either.ts","../src/isBooleanValue.ts","../src/deferThrow.ts","../src/bus.ts","../src/seq.ts","../src/mapFirst.ts","../src/isEmpty.ts","../src/isPositive.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,8eAAoB,CAAc;AAgCzC,YAAY,sCAAa,CAAqB"}
|