type-plus 3.15.0 → 4.0.2
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 +1 -55
- package/cjs/array/index.d.ts +17 -17
- package/cjs/array/index.js +5 -18
- package/cjs/array/index.js.map +1 -1
- package/cjs/assertion/index.js +5 -1
- package/cjs/assertion/index.js.map +1 -1
- package/cjs/class/index.d.ts +1 -1
- package/cjs/class/index.js +5 -2
- package/cjs/class/index.js.map +1 -1
- package/cjs/function/index.d.ts +1 -1
- package/cjs/function/index.js +0 -11
- package/cjs/function/index.js.map +1 -1
- package/cjs/functional/index.d.ts +1 -1
- package/cjs/functional/index.js +0 -12
- package/cjs/functional/index.js.map +1 -1
- package/cjs/index.d.ts +3 -7
- package/cjs/index.js +8 -22
- package/cjs/index.js.map +1 -1
- package/cjs/math/index.d.ts +7 -7
- package/cjs/math/index.js +0 -17
- package/cjs/math/index.js.map +1 -1
- package/cjs/nodejs/index.js +5 -1
- package/cjs/nodejs/index.js.map +1 -1
- package/cjs/nominal-types/index.js +5 -1
- package/cjs/nominal-types/index.js.map +1 -1
- package/cjs/object/index.d.ts +18 -18
- package/cjs/object/index.js +5 -19
- package/cjs/object/index.js.map +1 -1
- package/cjs/predicates/CanAssign.d.ts +1 -1
- package/cjs/predicates/{isEmptyObject.d.ts → IsEmptyObject.d.ts} +0 -0
- package/cjs/{types/AllType.js → predicates/IsEmptyObject.js} +1 -1
- package/cjs/predicates/IsEmptyObject.js.map +1 -0
- package/cjs/predicates/index.d.ts +5 -5
- package/cjs/predicates/index.js +5 -6
- package/cjs/predicates/index.js.map +1 -1
- package/cjs/promise/index.d.ts +2 -2
- package/cjs/promise/index.js +5 -3
- package/cjs/promise/index.js.map +1 -1
- package/cjs/utils/index.d.ts +1 -1
- package/cjs/utils/index.js +5 -2
- package/cjs/utils/index.js.map +1 -1
- package/esm/array/index.js +0 -17
- package/esm/array/index.js.map +1 -1
- package/esm/class/index.js +0 -1
- package/esm/class/index.js.map +1 -1
- package/esm/function/index.js +1 -1
- package/esm/function/index.js.map +1 -1
- package/esm/functional/index.js +1 -2
- package/esm/functional/index.js.map +1 -1
- package/esm/index.js +2 -7
- package/esm/index.js.map +1 -1
- package/esm/math/index.js +1 -7
- package/esm/math/index.js.map +1 -1
- package/esm/object/index.js +0 -18
- package/esm/object/index.js.map +1 -1
- package/esm/predicates/IsEmptyObject.js +2 -0
- package/esm/predicates/IsEmptyObject.js.map +1 -0
- package/esm/predicates/index.js +0 -5
- package/esm/predicates/index.js.map +1 -1
- package/esm/promise/index.js +0 -2
- package/esm/promise/index.js.map +1 -1
- package/esm/utils/index.js +0 -1
- package/esm/utils/index.js.map +1 -1
- package/package.json +20 -18
- package/ts/array/index.ts +19 -19
- package/ts/binary/_binary.ts +1 -1
- package/ts/class/index.ts +1 -1
- package/ts/function/index.ts +1 -1
- package/ts/functional/ChainFn.ts +6 -6
- package/ts/functional/index.ts +2 -2
- package/ts/index.spec.ts +6 -4
- package/ts/index.ts +7 -7
- package/ts/math/index.ts +7 -7
- package/ts/object/Partial.spec.ts +49 -49
- package/ts/object/index.ts +35 -35
- package/ts/predicates/CanAssign.ts +1 -1
- package/ts/predicates/{isEmptyObject.spec.ts → IsEmptyObject.spec.ts} +0 -0
- package/ts/predicates/{isEmptyObject.ts → IsEmptyObject.ts} +0 -0
- package/ts/predicates/index.ts +17 -17
- package/ts/promise/index.ts +2 -2
- package/ts/type-checker/typeChecker.spec.ts +2 -1
- package/ts/types/check.spec.ts +1 -1
- package/ts/types/conform.spec.ts +1 -1
- package/ts/types/index.ts +28 -28
- package/ts/types/satisfy.accept.ts +39 -38
- package/ts/types/satisfy.spec.ts +2 -1
- package/ts/utils/index.ts +2 -2
- package/cjs/predicates/isEmptyObject.js +0 -3
- package/cjs/predicates/isEmptyObject.js.map +0 -1
- package/cjs/types/AllType.d.ts +0 -18
- package/cjs/types/AllType.js.map +0 -1
- package/cjs/types/Any.d.ts +0 -6
- package/cjs/types/Any.js +0 -5
- package/cjs/types/Any.js.map +0 -1
- package/cjs/types/Array.d.ts +0 -28
- package/cjs/types/Array.js +0 -30
- package/cjs/types/Array.js.map +0 -1
- package/cjs/types/Boolean.d.ts +0 -29
- package/cjs/types/Boolean.js +0 -28
- package/cjs/types/Boolean.js.map +0 -1
- package/cjs/types/Generate.d.ts +0 -32
- package/cjs/types/Generate.js +0 -3
- package/cjs/types/Generate.js.map +0 -1
- package/cjs/types/Null.d.ts +0 -8
- package/cjs/types/Null.js +0 -10
- package/cjs/types/Null.js.map +0 -1
- package/cjs/types/Number.d.ts +0 -36
- package/cjs/types/Number.js +0 -50
- package/cjs/types/Number.js.map +0 -1
- package/cjs/types/Object.d.ts +0 -313
- package/cjs/types/Object.js +0 -35
- package/cjs/types/Object.js.map +0 -1
- package/cjs/types/Record.d.ts +0 -16
- package/cjs/types/Record.js +0 -17
- package/cjs/types/Record.js.map +0 -1
- package/cjs/types/String.d.ts +0 -36
- package/cjs/types/String.js +0 -51
- package/cjs/types/String.js.map +0 -1
- package/cjs/types/Symbol.d.ts +0 -8
- package/cjs/types/Symbol.js +0 -13
- package/cjs/types/Symbol.js.map +0 -1
- package/cjs/types/Tuple.d.ts +0 -35
- package/cjs/types/Tuple.js +0 -43
- package/cjs/types/Tuple.js.map +0 -1
- package/cjs/types/Undefined.d.ts +0 -6
- package/cjs/types/Undefined.js +0 -5
- package/cjs/types/Undefined.js.map +0 -1
- package/cjs/types/Union.d.ts +0 -20
- package/cjs/types/Union.js +0 -52
- package/cjs/types/Union.js.map +0 -1
- package/cjs/types/Unknown.d.ts +0 -6
- package/cjs/types/Unknown.js +0 -5
- package/cjs/types/Unknown.js.map +0 -1
- package/cjs/types/analyze.d.ts +0 -13
- package/cjs/types/analyze.js +0 -159
- package/cjs/types/analyze.js.map +0 -1
- package/cjs/types/check.d.ts +0 -14
- package/cjs/types/check.js +0 -25
- package/cjs/types/check.js.map +0 -1
- package/cjs/types/conform.d.ts +0 -15
- package/cjs/types/conform.js +0 -26
- package/cjs/types/conform.js.map +0 -1
- package/cjs/types/getPlainAnalysisReport.d.ts +0 -2
- package/cjs/types/getPlainAnalysisReport.js +0 -120
- package/cjs/types/getPlainAnalysisReport.js.map +0 -1
- package/cjs/types/index.d.ts +0 -26
- package/cjs/types/index.js +0 -45
- package/cjs/types/index.js.map +0 -1
- package/cjs/types/optional.d.ts +0 -328
- package/cjs/types/optional.js +0 -33
- package/cjs/types/optional.js.map +0 -1
- package/cjs/types/required.d.ts +0 -664
- package/cjs/types/required.js +0 -33
- package/cjs/types/required.js.map +0 -1
- package/cjs/types/satisfy.d.ts +0 -15
- package/cjs/types/satisfy.js +0 -26
- package/cjs/types/satisfy.js.map +0 -1
- package/cjs/types/types.d.ts +0 -9
- package/cjs/types/types.js +0 -3
- package/cjs/types/types.js.map +0 -1
- package/esm/predicates/isEmptyObject.js +0 -2
- package/esm/predicates/isEmptyObject.js.map +0 -1
- package/esm/types/AllType.js +0 -2
- package/esm/types/AllType.js.map +0 -1
- package/esm/types/Any.js +0 -2
- package/esm/types/Any.js.map +0 -1
- package/esm/types/Array.js +0 -27
- package/esm/types/Array.js.map +0 -1
- package/esm/types/Boolean.js +0 -25
- package/esm/types/Boolean.js.map +0 -1
- package/esm/types/Generate.js +0 -2
- package/esm/types/Generate.js.map +0 -1
- package/esm/types/Null.js +0 -7
- package/esm/types/Null.js.map +0 -1
- package/esm/types/Number.js +0 -30
- package/esm/types/Number.js.map +0 -1
- package/esm/types/Object.js +0 -31
- package/esm/types/Object.js.map +0 -1
- package/esm/types/Record.js +0 -14
- package/esm/types/Record.js.map +0 -1
- package/esm/types/String.js +0 -31
- package/esm/types/String.js.map +0 -1
- package/esm/types/Symbol.js +0 -10
- package/esm/types/Symbol.js.map +0 -1
- package/esm/types/Tuple.js +0 -23
- package/esm/types/Tuple.js.map +0 -1
- package/esm/types/Undefined.js +0 -2
- package/esm/types/Undefined.js.map +0 -1
- package/esm/types/Union.js +0 -32
- package/esm/types/Union.js.map +0 -1
- package/esm/types/Unknown.js +0 -2
- package/esm/types/Unknown.js.map +0 -1
- package/esm/types/analyze.js +0 -142
- package/esm/types/analyze.js.map +0 -1
- package/esm/types/check.js +0 -21
- package/esm/types/check.js.map +0 -1
- package/esm/types/conform.js +0 -22
- package/esm/types/conform.js.map +0 -1
- package/esm/types/getPlainAnalysisReport.js +0 -106
- package/esm/types/getPlainAnalysisReport.js.map +0 -1
- package/esm/types/index.js +0 -28
- package/esm/types/index.js.map +0 -1
- package/esm/types/optional.js +0 -30
- package/esm/types/optional.js.map +0 -1
- package/esm/types/required.js +0 -30
- package/esm/types/required.js.map +0 -1
- package/esm/types/satisfy.js +0 -22
- package/esm/types/satisfy.js.map +0 -1
- package/esm/types/types.js +0 -2
- package/esm/types/types.js.map +0 -1
package/cjs/promise/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,7 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
__exportStar(require("./isPromise"), exports);
|
|
14
|
-
__exportStar(require("./PromiseValue"), exports);
|
|
15
|
-
__exportStar(require("./PromiseValueMerge"), exports);
|
|
16
18
|
__exportStar(require("./mapSeries"), exports);
|
|
17
19
|
//# sourceMappingURL=index.js.map
|
package/cjs/promise/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/promise/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/promise/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAG3B,8CAA2B"}
|
package/cjs/utils/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './as';
|
|
2
|
-
export
|
|
2
|
+
export type { Widen } from './Widen';
|
package/cjs/utils/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,5 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
__exportStar(require("./as"), exports);
|
|
14
|
-
__exportStar(require("./Widen"), exports);
|
|
15
18
|
//# sourceMappingURL=index.js.map
|
package/cjs/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/utils/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uCAAoB"}
|
package/esm/array/index.js
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
export * from './CommonPropKeys';
|
|
2
|
-
export * from './Concat';
|
|
3
|
-
export * from './CreateTuple';
|
|
4
|
-
export * from './DropFirst';
|
|
5
|
-
export * from './DropLast';
|
|
6
|
-
export * from './Filter';
|
|
7
|
-
export * from './FindFirst';
|
|
8
|
-
export * from './FindLast';
|
|
9
|
-
export * from './Head';
|
|
10
|
-
export * from './IntersectOfProps';
|
|
11
|
-
export * from './IsArray';
|
|
12
1
|
export * from './literalArray';
|
|
13
|
-
export * from './PadLeft';
|
|
14
2
|
export * from './reduceWhile';
|
|
15
|
-
export * from './Reverse';
|
|
16
|
-
export * from './Some';
|
|
17
|
-
export * from './Tail';
|
|
18
|
-
export * from './UnionOfProps';
|
|
19
|
-
export * from './UnionOfValues';
|
|
20
3
|
//# sourceMappingURL=index.js.map
|
package/esm/array/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/array/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/array/index.ts"],"names":[],"mappings":"AAWA,cAAc,gBAAgB,CAAA;AAE9B,cAAc,eAAe,CAAA"}
|
package/esm/class/index.js
CHANGED
package/esm/class/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/class/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/class/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAA"}
|
package/esm/function/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/function/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/function/index.ts"],"names":[],"mappings":""}
|
package/esm/functional/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/functional/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/functional/index.ts"],"names":[],"mappings":""}
|
package/esm/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import * as types from './types'
|
|
1
|
+
// import * as types from './types'
|
|
2
2
|
export { required, requiredDeep } from 'unpartial';
|
|
3
3
|
export * from './array';
|
|
4
4
|
export * from './assertion';
|
|
5
5
|
export * from './class';
|
|
6
|
-
export * from './ComposableTypes';
|
|
7
6
|
export * from './function';
|
|
8
7
|
export * from './functional';
|
|
9
8
|
export * from './JSONTypes';
|
|
@@ -12,11 +11,7 @@ export * from './nodejs';
|
|
|
12
11
|
export * from './nominal-types';
|
|
13
12
|
export * from './object';
|
|
14
13
|
export * from './predicates';
|
|
15
|
-
export * from './PrimitiveTypes';
|
|
16
14
|
export * from './promise';
|
|
17
|
-
export * from './types/optional';
|
|
18
|
-
export * from './types/required';
|
|
19
|
-
export * from './UnionKeys';
|
|
20
15
|
export * from './utils';
|
|
21
|
-
export { types, types as T }
|
|
16
|
+
// export { types, types as T }
|
|
22
17
|
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAClD,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AAEvB,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAE5B,cAAc,WAAW,CAAA;AAIzB,cAAc,SAAS,CAAA;AACvB,+BAA+B"}
|
package/esm/math/index.js
CHANGED
package/esm/math/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/math/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/math/index.ts"],"names":[],"mappings":""}
|
package/esm/object/index.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
export * from '../object/IsDisjoint';
|
|
2
|
-
export * from './ANotB';
|
|
3
|
-
export * from './AnyRecord';
|
|
4
1
|
export * from './everyKey';
|
|
5
|
-
export * from './ExcludePropType';
|
|
6
2
|
export * from './facade';
|
|
7
3
|
export * from './filterKey';
|
|
8
4
|
export * from './findKey';
|
|
@@ -10,26 +6,12 @@ export * from './forEachKey';
|
|
|
10
6
|
export * from './getField';
|
|
11
7
|
export * from './hasKey';
|
|
12
8
|
export * from './hasProperty';
|
|
13
|
-
export * from './IsRecord';
|
|
14
|
-
export * from './KeyofOptional';
|
|
15
|
-
export * from './KeysWithDiffType';
|
|
16
|
-
export * from './KeyTypes';
|
|
17
|
-
export * from './KnownKeys';
|
|
18
9
|
export * from './mapKey';
|
|
19
10
|
export * from './mapProperties';
|
|
20
11
|
export * from './omit';
|
|
21
|
-
export * from './OptionalKeys';
|
|
22
|
-
export * from './Partial';
|
|
23
12
|
export * from './pick';
|
|
24
|
-
export * from './RecursiveIntersect';
|
|
25
|
-
export * from './RecursivePartial';
|
|
26
|
-
export * from './RecursiveRequired';
|
|
27
13
|
export * from './reduceKey';
|
|
28
14
|
export * from './replaceProperty';
|
|
29
|
-
export * from './Required';
|
|
30
|
-
export * from './RequiredKeys';
|
|
31
15
|
export * from './someKey';
|
|
32
|
-
export * from './SpreadRecord';
|
|
33
16
|
export * from './typeOverrideIncompatible';
|
|
34
|
-
export * from './ValueOf';
|
|
35
17
|
//# sourceMappingURL=index.js.map
|
package/esm/object/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/object/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/object/index.ts"],"names":[],"mappings":"AAEA,cAAc,YAAY,CAAA;AAE1B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAO7B,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,QAAQ,CAAA;AAGtB,cAAc,QAAQ,CAAA;AAItB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AAGjC,cAAc,WAAW,CAAA;AAEzB,cAAc,4BAA4B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IsEmptyObject.js","sourceRoot":"","sources":["../../ts/predicates/IsEmptyObject.ts"],"names":[],"mappings":""}
|
package/esm/predicates/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/predicates/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/predicates/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAI3B,cAAc,UAAU,CAAA"}
|
package/esm/promise/index.js
CHANGED
package/esm/promise/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/promise/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/promise/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAG3B,cAAc,aAAa,CAAA"}
|
package/esm/utils/index.js
CHANGED
package/esm/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "type-plus",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "Provides additional types for `typescript`.",
|
|
5
5
|
"homepage": "https://github.com/unional/type-plus",
|
|
6
6
|
"bugs": {
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"release": "npx semantic-release",
|
|
41
41
|
"size-limit": "size-limit",
|
|
42
42
|
"test": "jest",
|
|
43
|
-
"
|
|
43
|
+
"test:types": "tsc",
|
|
44
|
+
"verify": "run-p verify:build lint test:types coverage",
|
|
44
45
|
"verify:build": "npm-run-all clean build --parallel dependency-check size-limit",
|
|
45
46
|
"watch": "jest --watch"
|
|
46
47
|
},
|
|
@@ -50,38 +51,39 @@
|
|
|
50
51
|
}
|
|
51
52
|
},
|
|
52
53
|
"dependencies": {
|
|
53
|
-
"tersify": "^3.8.
|
|
54
|
+
"tersify": "^3.8.2",
|
|
54
55
|
"unpartial": "^0.6.4"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
|
-
"@babel/core": "^7.
|
|
58
|
+
"@babel/core": "^7.17.7",
|
|
58
59
|
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
59
60
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
|
|
60
61
|
"@babel/plugin-proposal-optional-chaining": "^7.16.7",
|
|
61
|
-
"@babel/preset-env": "^7.16.
|
|
62
|
+
"@babel/preset-env": "^7.16.11",
|
|
62
63
|
"@babel/preset-typescript": "^7.16.7",
|
|
63
|
-
"@commitlint/cli": "^16.
|
|
64
|
-
"@commitlint/config-conventional": "^16.
|
|
65
|
-
"@
|
|
66
|
-
"@
|
|
67
|
-
"@
|
|
68
|
-
"
|
|
64
|
+
"@commitlint/cli": "^16.2.3",
|
|
65
|
+
"@commitlint/config-conventional": "^16.2.1",
|
|
66
|
+
"@semantic-release/changelog": "^6.0.1",
|
|
67
|
+
"@size-limit/preset-small-lib": "^7.0.8",
|
|
68
|
+
"@types/jest": "^27.4.1",
|
|
69
|
+
"@unional/fixture": "^1.8.0",
|
|
70
|
+
"assertron": "^9.0.4",
|
|
69
71
|
"dependency-check": "^4.1.0",
|
|
70
|
-
"eslint": "^8.
|
|
72
|
+
"eslint": "^8.11.0",
|
|
71
73
|
"eslint-plugin-harmony": "^6.0.0",
|
|
72
74
|
"husky": "^7.0.4",
|
|
73
|
-
"jest": "^27.
|
|
74
|
-
"jest-progress-tracker": "^3.0.
|
|
75
|
-
"jest-validate": "^27.
|
|
75
|
+
"jest": "^27.5.1",
|
|
76
|
+
"jest-progress-tracker": "^3.0.3",
|
|
77
|
+
"jest-validate": "^27.5.1",
|
|
76
78
|
"jest-watch-repeat": "^2.0.0",
|
|
77
79
|
"jest-watch-suspend": "^1.1.2",
|
|
78
80
|
"jest-watch-toggle-config": "^2.0.1",
|
|
79
81
|
"jest-watch-typeahead": "^1.0.0",
|
|
80
82
|
"npm-run-all": "^4.1.5",
|
|
81
83
|
"rimraf": "^3.0.2",
|
|
82
|
-
"satisfier": "^5.1.
|
|
83
|
-
"size-limit": "^7.0.
|
|
84
|
-
"typescript": "^4.
|
|
84
|
+
"satisfier": "^5.1.2",
|
|
85
|
+
"size-limit": "^7.0.8",
|
|
86
|
+
"typescript": "^4.6.2"
|
|
85
87
|
},
|
|
86
88
|
"size-limit": [
|
|
87
89
|
{
|
package/ts/array/index.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export * from './literalArray'
|
|
13
|
-
export
|
|
14
|
-
export * from './reduceWhile'
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
1
|
+
export type { CommonKeys, CommonPropKeys } from './CommonPropKeys'
|
|
2
|
+
export type { Concat } from './Concat'
|
|
3
|
+
export type { CreateTuple } from './CreateTuple'
|
|
4
|
+
export type { DropFirst } from './DropFirst'
|
|
5
|
+
export type { DropLast } from './DropLast'
|
|
6
|
+
export type { Filter } from './Filter'
|
|
7
|
+
export type { FindFirst, First } from './FindFirst'
|
|
8
|
+
export type { FindLast } from './FindLast'
|
|
9
|
+
export type { Head } from './Head'
|
|
10
|
+
export type { IntersectOfProps, MapToProp } from './IntersectOfProps'
|
|
11
|
+
export type { IsArray } from './IsArray'
|
|
12
|
+
export * from './literalArray'
|
|
13
|
+
export type { PadLeft } from './PadLeft'
|
|
14
|
+
export * from './reduceWhile'
|
|
15
|
+
export type { Reverse } from './Reverse'
|
|
16
|
+
export type { Some } from './Some'
|
|
17
|
+
export type { Tail } from './Tail'
|
|
18
|
+
export type { PropUnion, UnionOfProps } from './UnionOfProps'
|
|
19
|
+
export type { ArrayValue, UnionOfValues } from './UnionOfValues'
|
package/ts/binary/_binary.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type { Bit, BitAnd, BitNot, BitOr, BitXor } from './Bit'
|
package/ts/class/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type { AnyConstructor } from './AnyConstructor'
|
|
2
2
|
export * from './isConstructor'
|
package/ts/function/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type { AnyFunction } from './AnyFunction'
|
package/ts/functional/ChainFn.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type ChainFn<T> = (param: T) => T
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* An endofunctor is a functor from one category back to the same category.
|
|
5
|
-
*/
|
|
6
|
-
export type EndoFn<T> = (param: T) => T
|
|
1
|
+
export type ChainFn<T> = (param: T) => T
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* An endofunctor is a functor from one category back to the same category.
|
|
5
|
+
*/
|
|
6
|
+
export type EndoFn<T> = (param: T) => T
|
package/ts/functional/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// export * from './Maybe'
|
|
2
|
-
export
|
|
1
|
+
// export * from './Maybe'
|
|
2
|
+
export type { ChainFn, EndoFn } from './ChainFn'
|
package/ts/index.spec.ts
CHANGED
package/ts/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as types from './types'
|
|
1
|
+
// import * as types from './types'
|
|
2
2
|
export { required, requiredDeep } from 'unpartial'
|
|
3
3
|
export * from './array'
|
|
4
4
|
export * from './assertion'
|
|
5
5
|
export * from './class'
|
|
6
|
-
export
|
|
6
|
+
export type { ComposableTypes, NonComposableTypes } from './ComposableTypes'
|
|
7
7
|
export * from './function'
|
|
8
8
|
export * from './functional'
|
|
9
9
|
export * from './JSONTypes'
|
|
@@ -12,10 +12,10 @@ export * from './nodejs'
|
|
|
12
12
|
export * from './nominal-types'
|
|
13
13
|
export * from './object'
|
|
14
14
|
export * from './predicates'
|
|
15
|
-
export
|
|
15
|
+
export type { PrimitiveTypes } from './PrimitiveTypes'
|
|
16
16
|
export * from './promise'
|
|
17
|
-
export * from './types/optional'
|
|
18
|
-
export * from './types/required'
|
|
19
|
-
export
|
|
17
|
+
// export * from './types/optional'
|
|
18
|
+
// export * from './types/required'
|
|
19
|
+
export type { UnionKeys } from './UnionKeys'
|
|
20
20
|
export * from './utils'
|
|
21
|
-
export { types, types as T }
|
|
21
|
+
// export { types, types as T }
|
package/ts/math/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
1
|
+
export type { Abs } from './Abs'
|
|
2
|
+
export type { Add, Increment } from './Add'
|
|
3
|
+
export type { GreaterThan } from './GreaterThan'
|
|
4
|
+
export type { IsPositive } from './IsPositive'
|
|
5
|
+
export type { IsWhole } from './IsWhole'
|
|
6
|
+
export type { Max } from './Max'
|
|
7
|
+
export type { Decrement, Subtract } from './Subtract'
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { assertType, PartialExcept, PartialOmit, PartialPick } from '..'
|
|
2
|
-
|
|
3
|
-
test('work on primitive type', () => {
|
|
4
|
-
type Foo = PartialPick<number, 'toFixed'>
|
|
5
|
-
const x: Foo = 1
|
|
6
|
-
assertType<typeof x['toFixed']>(1 as unknown as 1['toFixed'] | undefined)
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test('make picked properties optional', () => {
|
|
10
|
-
type Foo = {
|
|
11
|
-
a: number,
|
|
12
|
-
b: number,
|
|
13
|
-
c: number,
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const y: PartialPick<Foo, 'a'> = { b: 1, c: 2 }
|
|
17
|
-
|
|
18
|
-
y.a = undefined
|
|
19
|
-
assertType.noUndefined(y.b)
|
|
20
|
-
assertType.noUndefined(y.c)
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
test('make not specified properties optional', () => {
|
|
24
|
-
type Foo = {
|
|
25
|
-
a: number,
|
|
26
|
-
b: number,
|
|
27
|
-
c: number,
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const y: PartialExcept<Foo, 'a'> = { a: 1 }
|
|
31
|
-
assertType.noUndefined(y.a)
|
|
32
|
-
y.b = undefined
|
|
33
|
-
y.c = undefined
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
test('make not specified properties optional', () => {
|
|
38
|
-
type Foo = {
|
|
39
|
-
a: number,
|
|
40
|
-
b: number,
|
|
41
|
-
c: number,
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const y: PartialOmit<Foo, 'a'> = { a: 1 }
|
|
45
|
-
|
|
46
|
-
assertType.noUndefined(y.a)
|
|
47
|
-
y.b = undefined
|
|
48
|
-
y.c = undefined
|
|
49
|
-
})
|
|
1
|
+
import { assertType, PartialExcept, PartialOmit, PartialPick } from '..'
|
|
2
|
+
|
|
3
|
+
test('work on primitive type', () => {
|
|
4
|
+
type Foo = PartialPick<number, 'toFixed'>
|
|
5
|
+
const x: Foo = 1
|
|
6
|
+
assertType<typeof x['toFixed']>(1 as unknown as 1['toFixed'] | undefined)
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
test('make picked properties optional', () => {
|
|
10
|
+
type Foo = {
|
|
11
|
+
a: number,
|
|
12
|
+
b: number,
|
|
13
|
+
c: number,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const y: PartialPick<Foo, 'a'> = { b: 1, c: 2 }
|
|
17
|
+
|
|
18
|
+
y.a = undefined
|
|
19
|
+
assertType.noUndefined(y.b)
|
|
20
|
+
assertType.noUndefined(y.c)
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
test('make not specified properties optional', () => {
|
|
24
|
+
type Foo = {
|
|
25
|
+
a: number,
|
|
26
|
+
b: number,
|
|
27
|
+
c: number,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const y: PartialExcept<Foo, 'a'> = { a: 1 }
|
|
31
|
+
assertType.noUndefined(y.a)
|
|
32
|
+
y.b = undefined
|
|
33
|
+
y.c = undefined
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
test('make not specified properties optional', () => {
|
|
38
|
+
type Foo = {
|
|
39
|
+
a: number,
|
|
40
|
+
b: number,
|
|
41
|
+
c: number,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const y: PartialOmit<Foo, 'a'> = { a: 1 }
|
|
45
|
+
|
|
46
|
+
assertType.noUndefined(y.a)
|
|
47
|
+
y.b = undefined
|
|
48
|
+
y.c = undefined
|
|
49
|
+
})
|
package/ts/object/index.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export * from './
|
|
4
|
-
export
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export * from './mapKey'
|
|
19
|
-
export * from './mapProperties'
|
|
20
|
-
export * from './omit'
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export * from './pick'
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export * from './reduceKey'
|
|
28
|
-
export * from './replaceProperty'
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export * from './someKey'
|
|
32
|
-
export
|
|
33
|
-
export * from './typeOverrideIncompatible'
|
|
34
|
-
export
|
|
35
|
-
|
|
1
|
+
export type { ANotB, BNotA, LeftJoin } from './ANotB'
|
|
2
|
+
export type { AnyRecord } from './AnyRecord'
|
|
3
|
+
export * from './everyKey'
|
|
4
|
+
export type { ExcludePropType } from './ExcludePropType'
|
|
5
|
+
export * from './facade'
|
|
6
|
+
export * from './filterKey'
|
|
7
|
+
export * from './findKey'
|
|
8
|
+
export * from './forEachKey'
|
|
9
|
+
export * from './getField'
|
|
10
|
+
export * from './hasKey'
|
|
11
|
+
export * from './hasProperty'
|
|
12
|
+
export type { IsDisjoint } from './IsDisjoint'
|
|
13
|
+
export type { IsRecord } from './IsRecord'
|
|
14
|
+
export type { KeysOfOptional } from './KeyofOptional'
|
|
15
|
+
export type { KeysWithDiffType } from './KeysWithDiffType'
|
|
16
|
+
export type { KeyTypes } from './KeyTypes'
|
|
17
|
+
export type { KnownKeys } from './KnownKeys'
|
|
18
|
+
export * from './mapKey'
|
|
19
|
+
export * from './mapProperties'
|
|
20
|
+
export * from './omit'
|
|
21
|
+
export type { OptionalKeys } from './OptionalKeys'
|
|
22
|
+
export type { PartialOmit, PartialPick, PartialExcept } from './Partial'
|
|
23
|
+
export * from './pick'
|
|
24
|
+
export type { RecursiveIntersect } from './RecursiveIntersect'
|
|
25
|
+
export type { RecursivePartial } from './RecursivePartial'
|
|
26
|
+
export type { RecursiveRequired } from './RecursiveRequired'
|
|
27
|
+
export * from './reduceKey'
|
|
28
|
+
export * from './replaceProperty'
|
|
29
|
+
export type { RequiredExcept, RequiredPick } from './Required'
|
|
30
|
+
export type { RequiredKeys } from './RequiredKeys'
|
|
31
|
+
export * from './someKey'
|
|
32
|
+
export type { SpreadRecord } from './SpreadRecord'
|
|
33
|
+
export * from './typeOverrideIncompatible'
|
|
34
|
+
export type { ValueOf } from './ValueOf'
|
|
35
|
+
|