type-plus 4.0.0 → 4.1.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.
Files changed (92) hide show
  1. package/README.md +3 -2
  2. package/cjs/array/index.d.ts +17 -17
  3. package/cjs/array/index.js +5 -18
  4. package/cjs/array/index.js.map +1 -1
  5. package/cjs/assertion/index.js +5 -1
  6. package/cjs/assertion/index.js.map +1 -1
  7. package/cjs/class/index.d.ts +1 -1
  8. package/cjs/class/index.js +5 -2
  9. package/cjs/class/index.js.map +1 -1
  10. package/cjs/function/index.d.ts +1 -1
  11. package/cjs/function/index.js +0 -11
  12. package/cjs/function/index.js.map +1 -1
  13. package/cjs/functional/index.d.ts +1 -1
  14. package/cjs/functional/index.js +0 -12
  15. package/cjs/functional/index.js.map +1 -1
  16. package/cjs/index.d.ts +3 -3
  17. package/cjs/index.js +5 -6
  18. package/cjs/index.js.map +1 -1
  19. package/cjs/math/index.d.ts +7 -7
  20. package/cjs/math/index.js +0 -17
  21. package/cjs/math/index.js.map +1 -1
  22. package/cjs/nodejs/index.js +5 -1
  23. package/cjs/nodejs/index.js.map +1 -1
  24. package/cjs/nominal-types/index.js +5 -1
  25. package/cjs/nominal-types/index.js.map +1 -1
  26. package/cjs/object/index.d.ts +19 -18
  27. package/cjs/object/index.js +6 -19
  28. package/cjs/object/index.js.map +1 -1
  29. package/cjs/object/split.d.ts +80 -0
  30. package/cjs/object/split.js +25 -0
  31. package/cjs/object/split.js.map +1 -0
  32. package/cjs/predicates/CanAssign.d.ts +1 -1
  33. package/cjs/predicates/{isEmptyObject.d.ts → IsEmptyObject.d.ts} +0 -0
  34. package/cjs/predicates/{isEmptyObject.js → IsEmptyObject.js} +1 -1
  35. package/cjs/predicates/IsEmptyObject.js.map +1 -0
  36. package/cjs/predicates/index.d.ts +5 -5
  37. package/cjs/predicates/index.js +5 -6
  38. package/cjs/predicates/index.js.map +1 -1
  39. package/cjs/promise/index.d.ts +2 -2
  40. package/cjs/promise/index.js +5 -3
  41. package/cjs/promise/index.js.map +1 -1
  42. package/cjs/utils/index.d.ts +1 -1
  43. package/cjs/utils/index.js +5 -2
  44. package/cjs/utils/index.js.map +1 -1
  45. package/esm/array/index.js +0 -17
  46. package/esm/array/index.js.map +1 -1
  47. package/esm/class/index.js +0 -1
  48. package/esm/class/index.js.map +1 -1
  49. package/esm/function/index.js +1 -1
  50. package/esm/function/index.js.map +1 -1
  51. package/esm/functional/index.js +1 -2
  52. package/esm/functional/index.js.map +1 -1
  53. package/esm/index.js +0 -5
  54. package/esm/index.js.map +1 -1
  55. package/esm/math/index.js +1 -7
  56. package/esm/math/index.js.map +1 -1
  57. package/esm/object/index.js +1 -18
  58. package/esm/object/index.js.map +1 -1
  59. package/esm/object/split.js +8 -0
  60. package/esm/object/split.js.map +1 -0
  61. package/esm/predicates/IsEmptyObject.js +2 -0
  62. package/esm/predicates/IsEmptyObject.js.map +1 -0
  63. package/esm/predicates/index.js +0 -5
  64. package/esm/predicates/index.js.map +1 -1
  65. package/esm/promise/index.js +0 -2
  66. package/esm/promise/index.js.map +1 -1
  67. package/esm/utils/index.js +0 -1
  68. package/esm/utils/index.js.map +1 -1
  69. package/package.json +20 -18
  70. package/ts/array/index.ts +19 -19
  71. package/ts/binary/_binary.ts +1 -1
  72. package/ts/class/index.ts +1 -1
  73. package/ts/function/index.ts +1 -1
  74. package/ts/functional/ChainFn.ts +6 -6
  75. package/ts/functional/index.ts +2 -2
  76. package/ts/index.spec.ts +6 -4
  77. package/ts/index.ts +3 -3
  78. package/ts/math/index.ts +7 -7
  79. package/ts/object/Partial.spec.ts +49 -49
  80. package/ts/object/index.ts +35 -35
  81. package/ts/object/split.spec.ts +54 -0
  82. package/ts/object/split.ts +191 -0
  83. package/ts/predicates/CanAssign.ts +1 -1
  84. package/ts/predicates/{isEmptyObject.spec.ts → IsEmptyObject.spec.ts} +0 -0
  85. package/ts/predicates/{isEmptyObject.ts → IsEmptyObject.ts} +0 -0
  86. package/ts/predicates/index.ts +17 -17
  87. package/ts/promise/index.ts +2 -2
  88. package/ts/types/index.ts +28 -28
  89. package/ts/utils/index.ts +2 -2
  90. package/cjs/predicates/isEmptyObject.js.map +0 -1
  91. package/esm/predicates/isEmptyObject.js +0 -2
  92. package/esm/predicates/isEmptyObject.js.map +0 -1
package/README.md CHANGED
@@ -397,7 +397,7 @@ JSONTypes.get<string>(someJson, 'a', 'b', 1, 'c') // miku
397
397
  - `IsRecord<T>`: `logical` predicate for `Record`.
398
398
  - `KeysWithDiffTypes<A, B>`: gets the keys common in `A` and `B` but with different value type.
399
399
  - `mapKey()`: type adjusted map by key.
400
- - `reduceKey()`: type adjusted reduce by key.
400
+ - `reduceByKey()`: type adjusted reduce by key.
401
401
  - `someKey()`: type adjusted some by key.
402
402
  - `SpreadRecord<A, B>`: type for `{...a, ...b}` when both `a` and `b` are `Record`. \
403
403
  for array, just do `[...A, ...B]`.
@@ -489,10 +489,11 @@ So you may encounter some weird behavior if your logic is complex.
489
489
  - `hasProperty(value, prop)`: assert `value` has property `prop`. This will pick the correct union type.
490
490
  - `isConstructor(subject)`: type guard `subject` is a constructor.
491
491
  - `isSystemError(code, err)`: type guard `err` with Nodejs error code.
492
- - `pick(obj, ...props)`: pick properties from `obj`.
493
492
  - `omit(obj, ...props)`: omit properties from `obj`.
493
+ - `pick(obj, ...props)`: pick properties from `obj`.
494
494
  - `required(...)`: merge options and removing `Partial<T>`. From [`unpartial`](https://github.com/unional/unpartial)
495
495
  - `requiredDeep(...)`: merge options deeply and removing `Partial<T>`. From [`unpartial`](https://github.com/unional/unpartial)
496
+ - `split(target, ...splitters)`: split one object into multiple objects.
496
497
  - `typeOverrideIncompatible<T>()`: override only the incompatible portion between two types.
497
498
 
498
499
  ```ts
@@ -1,19 +1,19 @@
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';
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
12
  export * from './literalArray';
13
- export * from './PadLeft';
13
+ export type { PadLeft } from './PadLeft';
14
14
  export * from './reduceWhile';
15
- export * from './Reverse';
16
- export * from './Some';
17
- export * from './Tail';
18
- export * from './UnionOfProps';
19
- export * from './UnionOfValues';
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';
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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];
@@ -10,23 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
15
  };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./CommonPropKeys"), exports);
14
- __exportStar(require("./Concat"), exports);
15
- __exportStar(require("./CreateTuple"), exports);
16
- __exportStar(require("./DropFirst"), exports);
17
- __exportStar(require("./DropLast"), exports);
18
- __exportStar(require("./Filter"), exports);
19
- __exportStar(require("./FindFirst"), exports);
20
- __exportStar(require("./FindLast"), exports);
21
- __exportStar(require("./Head"), exports);
22
- __exportStar(require("./IntersectOfProps"), exports);
23
- __exportStar(require("./IsArray"), exports);
24
17
  __exportStar(require("./literalArray"), exports);
25
- __exportStar(require("./PadLeft"), exports);
26
18
  __exportStar(require("./reduceWhile"), exports);
27
- __exportStar(require("./Reverse"), exports);
28
- __exportStar(require("./Some"), exports);
29
- __exportStar(require("./Tail"), exports);
30
- __exportStar(require("./UnionOfProps"), exports);
31
- __exportStar(require("./UnionOfValues"), exports);
32
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/array/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAgC;AAChC,2CAAwB;AACxB,gDAA6B;AAC7B,8CAA2B;AAC3B,6CAA0B;AAC1B,2CAAwB;AACxB,8CAA2B;AAC3B,6CAA0B;AAC1B,yCAAsB;AACtB,qDAAkC;AAClC,4CAAyB;AACzB,iDAA8B;AAC9B,4CAAyB;AACzB,gDAA6B;AAC7B,4CAAyB;AACzB,yCAAsB;AACtB,yCAAsB;AACtB,iDAA8B;AAC9B,kDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/array/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAWA,iDAA8B;AAE9B,gDAA6B"}
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/assertion/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/assertion/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B"}
@@ -1,2 +1,2 @@
1
- export * from './AnyConstructor';
1
+ export type { AnyConstructor } from './AnyConstructor';
2
2
  export * from './isConstructor';
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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];
@@ -10,6 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
15
  };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./AnyConstructor"), exports);
14
17
  __exportStar(require("./isConstructor"), exports);
15
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/class/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAgC;AAChC,kDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/class/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,kDAA+B"}
@@ -1 +1 @@
1
- export * from './AnyFunction';
1
+ export type { AnyFunction } from './AnyFunction';
@@ -1,14 +1,3 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
2
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./AnyFunction"), exports);
14
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/function/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/function/index.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- export * from './ChainFn';
1
+ export type { ChainFn, EndoFn } from './ChainFn';
@@ -1,15 +1,3 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
2
  Object.defineProperty(exports, "__esModule", { value: true });
13
- // export * from './Maybe'
14
- __exportStar(require("./ChainFn"), exports);
15
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/functional/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0BAA0B;AAC1B,4CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/functional/index.ts"],"names":[],"mappings":""}
package/cjs/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export { required, requiredDeep } from 'unpartial';
2
2
  export * from './array';
3
3
  export * from './assertion';
4
4
  export * from './class';
5
- export * from './ComposableTypes';
5
+ export type { ComposableTypes, NonComposableTypes } from './ComposableTypes';
6
6
  export * from './function';
7
7
  export * from './functional';
8
8
  export * from './JSONTypes';
@@ -11,7 +11,7 @@ export * from './nodejs';
11
11
  export * from './nominal-types';
12
12
  export * from './object';
13
13
  export * from './predicates';
14
- export * from './PrimitiveTypes';
14
+ export type { PrimitiveTypes } from './PrimitiveTypes';
15
15
  export * from './promise';
16
- export * from './UnionKeys';
16
+ export type { UnionKeys } from './UnionKeys';
17
17
  export * from './utils';
package/cjs/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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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];
@@ -18,7 +22,6 @@ Object.defineProperty(exports, "requiredDeep", { enumerable: true, get: function
18
22
  __exportStar(require("./array"), exports);
19
23
  __exportStar(require("./assertion"), exports);
20
24
  __exportStar(require("./class"), exports);
21
- __exportStar(require("./ComposableTypes"), exports);
22
25
  __exportStar(require("./function"), exports);
23
26
  __exportStar(require("./functional"), exports);
24
27
  __exportStar(require("./JSONTypes"), exports);
@@ -27,11 +30,7 @@ __exportStar(require("./nodejs"), exports);
27
30
  __exportStar(require("./nominal-types"), exports);
28
31
  __exportStar(require("./object"), exports);
29
32
  __exportStar(require("./predicates"), exports);
30
- __exportStar(require("./PrimitiveTypes"), exports);
31
33
  __exportStar(require("./promise"), exports);
32
- // export * from './types/optional'
33
- // export * from './types/required'
34
- __exportStar(require("./UnionKeys"), exports);
35
34
  __exportStar(require("./utils"), exports);
36
35
  // export { types, types as T }
37
36
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mCAAmC;AACnC,uCAAkD;AAAzC,qGAAA,QAAQ,OAAA;AAAE,yGAAA,YAAY,OAAA;AAC/B,0CAAuB;AACvB,8CAA2B;AAC3B,0CAAuB;AACvB,oDAAiC;AACjC,6CAA0B;AAC1B,+CAA4B;AAC5B,8CAA2B;AAC3B,yCAAsB;AACtB,2CAAwB;AACxB,kDAA+B;AAC/B,2CAAwB;AACxB,+CAA4B;AAC5B,mDAAgC;AAChC,4CAAyB;AACzB,mCAAmC;AACnC,mCAAmC;AACnC,8CAA2B;AAC3B,0CAAuB;AACvB,+BAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mCAAmC;AACnC,uCAAkD;AAAzC,qGAAA,QAAQ,OAAA;AAAE,yGAAA,YAAY,OAAA;AAC/B,0CAAuB;AACvB,8CAA2B;AAC3B,0CAAuB;AAEvB,6CAA0B;AAC1B,+CAA4B;AAC5B,8CAA2B;AAC3B,yCAAsB;AACtB,2CAAwB;AACxB,kDAA+B;AAC/B,2CAAwB;AACxB,+CAA4B;AAE5B,4CAAyB;AAIzB,0CAAuB;AACvB,+BAA+B"}
@@ -1,7 +1,7 @@
1
- export * from './Abs';
2
- export * from './Add';
3
- export * from './GreaterThan';
4
- export * from './IsPositive';
5
- export * from './IsWhole';
6
- export * from './Max';
7
- export * from './Subtract';
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';
package/cjs/math/index.js CHANGED
@@ -1,20 +1,3 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
2
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./Abs"), exports);
14
- __exportStar(require("./Add"), exports);
15
- __exportStar(require("./GreaterThan"), exports);
16
- __exportStar(require("./IsPositive"), exports);
17
- __exportStar(require("./IsWhole"), exports);
18
- __exportStar(require("./Max"), exports);
19
- __exportStar(require("./Subtract"), exports);
20
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/math/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAqB;AACrB,wCAAqB;AACrB,gDAA6B;AAC7B,+CAA4B;AAC5B,4CAAyB;AACzB,wCAAqB;AACrB,6CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/math/index.ts"],"names":[],"mappings":""}
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/nodejs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/nodejs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B"}
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/nominal-types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAuB;AACvB,2CAAwB;AACxB,iDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/nominal-types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,2CAAwB;AACxB,iDAA8B"}
@@ -1,8 +1,7 @@
1
- export * from '../object/IsDisjoint';
2
- export * from './ANotB';
3
- export * from './AnyRecord';
1
+ export type { ANotB, BNotA, LeftJoin } from './ANotB';
2
+ export type { AnyRecord } from './AnyRecord';
4
3
  export * from './everyKey';
5
- export * from './ExcludePropType';
4
+ export type { ExcludePropType } from './ExcludePropType';
6
5
  export * from './facade';
7
6
  export * from './filterKey';
8
7
  export * from './findKey';
@@ -10,25 +9,27 @@ export * from './forEachKey';
10
9
  export * from './getField';
11
10
  export * from './hasKey';
12
11
  export * from './hasProperty';
13
- export * from './IsRecord';
14
- export * from './KeyofOptional';
15
- export * from './KeysWithDiffType';
16
- export * from './KeyTypes';
17
- export * from './KnownKeys';
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
18
  export * from './mapKey';
19
19
  export * from './mapProperties';
20
20
  export * from './omit';
21
- export * from './OptionalKeys';
22
- export * from './Partial';
21
+ export type { OptionalKeys } from './OptionalKeys';
22
+ export type { PartialExcept, PartialOmit, PartialPick } from './Partial';
23
23
  export * from './pick';
24
- export * from './RecursiveIntersect';
25
- export * from './RecursivePartial';
26
- export * from './RecursiveRequired';
24
+ export type { RecursiveIntersect } from './RecursiveIntersect';
25
+ export type { RecursivePartial } from './RecursivePartial';
26
+ export type { RecursiveRequired } from './RecursiveRequired';
27
27
  export * from './reduceKey';
28
28
  export * from './replaceProperty';
29
- export * from './Required';
30
- export * from './RequiredKeys';
29
+ export type { RequiredExcept, RequiredPick } from './Required';
30
+ export type { RequiredKeys } from './RequiredKeys';
31
31
  export * from './someKey';
32
- export * from './SpreadRecord';
32
+ export * from './split';
33
+ export type { SpreadRecord } from './SpreadRecord';
33
34
  export * from './typeOverrideIncompatible';
34
- export * from './ValueOf';
35
+ export type { ValueOf } from './ValueOf';
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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];
@@ -10,11 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
15
  };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("../object/IsDisjoint"), exports);
14
- __exportStar(require("./ANotB"), exports);
15
- __exportStar(require("./AnyRecord"), exports);
16
17
  __exportStar(require("./everyKey"), exports);
17
- __exportStar(require("./ExcludePropType"), exports);
18
18
  __exportStar(require("./facade"), exports);
19
19
  __exportStar(require("./filterKey"), exports);
20
20
  __exportStar(require("./findKey"), exports);
@@ -22,26 +22,13 @@ __exportStar(require("./forEachKey"), exports);
22
22
  __exportStar(require("./getField"), exports);
23
23
  __exportStar(require("./hasKey"), exports);
24
24
  __exportStar(require("./hasProperty"), exports);
25
- __exportStar(require("./IsRecord"), exports);
26
- __exportStar(require("./KeyofOptional"), exports);
27
- __exportStar(require("./KeysWithDiffType"), exports);
28
- __exportStar(require("./KeyTypes"), exports);
29
- __exportStar(require("./KnownKeys"), exports);
30
25
  __exportStar(require("./mapKey"), exports);
31
26
  __exportStar(require("./mapProperties"), exports);
32
27
  __exportStar(require("./omit"), exports);
33
- __exportStar(require("./OptionalKeys"), exports);
34
- __exportStar(require("./Partial"), exports);
35
28
  __exportStar(require("./pick"), exports);
36
- __exportStar(require("./RecursiveIntersect"), exports);
37
- __exportStar(require("./RecursivePartial"), exports);
38
- __exportStar(require("./RecursiveRequired"), exports);
39
29
  __exportStar(require("./reduceKey"), exports);
40
30
  __exportStar(require("./replaceProperty"), exports);
41
- __exportStar(require("./Required"), exports);
42
- __exportStar(require("./RequiredKeys"), exports);
43
31
  __exportStar(require("./someKey"), exports);
44
- __exportStar(require("./SpreadRecord"), exports);
32
+ __exportStar(require("./split"), exports);
45
33
  __exportStar(require("./typeOverrideIncompatible"), exports);
46
- __exportStar(require("./ValueOf"), exports);
47
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/object/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAoC;AACpC,0CAAuB;AACvB,8CAA2B;AAC3B,6CAA0B;AAC1B,oDAAiC;AACjC,2CAAwB;AACxB,8CAA2B;AAC3B,4CAAyB;AACzB,+CAA4B;AAC5B,6CAA0B;AAC1B,2CAAwB;AACxB,gDAA6B;AAC7B,6CAA0B;AAC1B,kDAA+B;AAC/B,qDAAkC;AAClC,6CAA0B;AAC1B,8CAA2B;AAC3B,2CAAwB;AACxB,kDAA+B;AAC/B,yCAAsB;AACtB,iDAA8B;AAC9B,4CAAyB;AACzB,yCAAsB;AACtB,uDAAoC;AACpC,qDAAkC;AAClC,sDAAmC;AACnC,8CAA2B;AAC3B,oDAAiC;AACjC,6CAA0B;AAC1B,iDAA8B;AAC9B,4CAAyB;AACzB,iDAA8B;AAC9B,6DAA0C;AAC1C,4CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/object/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,6CAA0B;AAE1B,2CAAwB;AACxB,8CAA2B;AAC3B,4CAAyB;AACzB,+CAA4B;AAC5B,6CAA0B;AAC1B,2CAAwB;AACxB,gDAA6B;AAO7B,2CAAwB;AACxB,kDAA+B;AAC/B,yCAAsB;AAGtB,yCAAsB;AAItB,8CAA2B;AAC3B,oDAAiC;AAGjC,4CAAyB;AACzB,0CAAuB;AAEvB,6DAA0C"}
@@ -0,0 +1,80 @@
1
+ import { AnyRecord, Omit } from '..';
2
+ declare type Splitter<T extends AnyRecord> = Partial<{
3
+ [k in keyof T]: T[k] | undefined;
4
+ }>;
5
+ declare type Split<T extends AnyRecord, S extends AnyRecord> = {
6
+ [k in keyof S]: NonNullable<T[k]> | S[k];
7
+ };
8
+ export declare function split<T extends AnyRecord, S1 extends Splitter<T>>(target: T, split1: S1): [
9
+ Split<T, S1>,
10
+ Omit<T, keyof S1>
11
+ ];
12
+ export declare function split<T extends AnyRecord, S1 extends Splitter<T>, S2 extends Splitter<T>>(target: T, split1: S1, split2: S2): [
13
+ Split<T, S1>,
14
+ Split<T, S2>,
15
+ Omit<T, keyof S1 | keyof S2>
16
+ ];
17
+ export declare function split<T extends AnyRecord, S1 extends Splitter<T>, S2 extends Splitter<T>, S3 extends Splitter<T>>(target: T, splitter1: S1, splitter2: S2, splitter3: S3): [
18
+ Split<T, S1>,
19
+ Split<T, S2>,
20
+ Split<T, S3>,
21
+ Omit<T, keyof S1 | keyof S2 | keyof S3>
22
+ ];
23
+ export declare function split<T extends AnyRecord, S1 extends Splitter<T>, S2 extends Splitter<T>, S3 extends Splitter<T>, S4 extends Splitter<T>>(target: T, splitter1: S1, splitter2: S2, splitter3: S3, splitter4: S4): [
24
+ Split<T, S1>,
25
+ Split<T, S2>,
26
+ Split<T, S3>,
27
+ Split<T, S4>,
28
+ Omit<T, keyof S1 | keyof S2 | keyof S3 | keyof S4>
29
+ ];
30
+ export declare function split<T extends AnyRecord, S1 extends Splitter<T>, S2 extends Splitter<T>, S3 extends Splitter<T>, S4 extends Splitter<T>, S5 extends Splitter<T>>(target: T, splitter1: S1, splitter2: S2, splitter3: S3, splitter4: S4, splitter5: S5): [
31
+ Split<T, S1>,
32
+ Split<T, S2>,
33
+ Split<T, S3>,
34
+ Split<T, S4>,
35
+ Split<T, S5>,
36
+ Omit<T, keyof S1 | keyof S2 | keyof S3 | keyof S4 | keyof S5>
37
+ ];
38
+ export declare function split<T extends AnyRecord, S1 extends Splitter<T>, S2 extends Splitter<T>, S3 extends Splitter<T>, S4 extends Splitter<T>, S5 extends Splitter<T>, S6 extends Splitter<T>>(target: T, splitter1: S1, splitter2: S2, splitter3: S3, splitter4: S4, splitter5: S5, splitter6: S6): [
39
+ Split<T, S1>,
40
+ Split<T, S2>,
41
+ Split<T, S3>,
42
+ Split<T, S4>,
43
+ Split<T, S5>,
44
+ Split<T, S6>,
45
+ Omit<T, keyof S1 | keyof S2 | keyof S3 | keyof S4 | keyof S5 | keyof S6>
46
+ ];
47
+ export declare function split<T extends AnyRecord, S1 extends Splitter<T>, S2 extends Splitter<T>, S3 extends Splitter<T>, S4 extends Splitter<T>, S5 extends Splitter<T>, S6 extends Splitter<T>, S7 extends Splitter<T>>(target: T, splitter1: S1, splitter2: S2, splitter3: S3, splitter4: S4, splitter5: S5, splitter6: S6, splitter7: S7): [
48
+ Split<T, S1>,
49
+ Split<T, S2>,
50
+ Split<T, S3>,
51
+ Split<T, S4>,
52
+ Split<T, S5>,
53
+ Split<T, S6>,
54
+ Split<T, S7>,
55
+ Omit<T, keyof S1 | keyof S2 | keyof S3 | keyof S4 | keyof S5 | keyof S6 | keyof S7>
56
+ ];
57
+ export declare function split<T extends AnyRecord, S1 extends Splitter<T>, S2 extends Splitter<T>, S3 extends Splitter<T>, S4 extends Splitter<T>, S5 extends Splitter<T>, S6 extends Splitter<T>, S7 extends Splitter<T>, S8 extends Splitter<T>>(target: T, splitter1: S1, splitter2: S2, splitter3: S3, splitter4: S4, splitter5: S5, splitter6: S6, splitter7: S7, splitter8: S8): [
58
+ Split<T, S1>,
59
+ Split<T, S2>,
60
+ Split<T, S3>,
61
+ Split<T, S4>,
62
+ Split<T, S5>,
63
+ Split<T, S6>,
64
+ Split<T, S7>,
65
+ Split<T, S8>,
66
+ Omit<T, keyof S1 | keyof S2 | keyof S3 | keyof S4 | keyof S5 | keyof S6 | keyof S7 | keyof S8>
67
+ ];
68
+ export declare function split<T extends AnyRecord, S1 extends Splitter<T>, S2 extends Splitter<T>, S3 extends Splitter<T>, S4 extends Splitter<T>, S5 extends Splitter<T>, S6 extends Splitter<T>, S7 extends Splitter<T>, S8 extends Splitter<T>, S9 extends Splitter<T>>(target: T, splitter1: S1, splitter2: S2, splitter3: S3, splitter4: S4, splitter5: S5, splitter6: S6, splitter7: S7, splitter8: S8, splitter9: S9): [
69
+ Split<T, S1>,
70
+ Split<T, S2>,
71
+ Split<T, S3>,
72
+ Split<T, S4>,
73
+ Split<T, S5>,
74
+ Split<T, S6>,
75
+ Split<T, S7>,
76
+ Split<T, S8>,
77
+ Split<T, S9>,
78
+ Omit<T, keyof S1 | keyof S2 | keyof S3 | keyof S4 | keyof S5 | keyof S6 | keyof S7 | keyof S8 | keyof S9>
79
+ ];
80
+ export {};
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
+ if (ar || !(i in from)) {
5
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
+ ar[i] = from[i];
7
+ }
8
+ }
9
+ return to.concat(ar || Array.prototype.slice.call(from));
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.split = void 0;
13
+ var __1 = require("..");
14
+ function split(target) {
15
+ var splitters = [];
16
+ for (var _i = 1; _i < arguments.length; _i++) {
17
+ splitters[_i - 1] = arguments[_i];
18
+ }
19
+ var keyMap = {};
20
+ var s = splitters.map(function (s) { return (0, __1.reduceByKey)(s, function (p, k) { var _a; return (keyMap[k] = true, p[k] = (_a = target[k]) !== null && _a !== void 0 ? _a : s[k], p); }, {}); });
21
+ var r = (0, __1.reduceByKey)(target, function (p, k) { return keyMap[k] ? p : (p[k] = target[k], p); }, {});
22
+ return __spreadArray(__spreadArray([], s, true), [r], false);
23
+ }
24
+ exports.split = split;
25
+ //# sourceMappingURL=split.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split.js","sourceRoot":"","sources":["../../ts/object/split.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wBAAiD;AAyLjD,SAAgB,KAAK,CAAC,MAAiB;IAAE,mBAAyB;SAAzB,UAAyB,EAAzB,qBAAyB,EAAzB,IAAyB;QAAzB,kCAAyB;;IAChE,IAAM,MAAM,GAAc,EAAE,CAAA;IAC5B,IAAM,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,IAAA,eAAW,EAAC,CAAC,EAAE,UAAC,CAAC,EAAE,CAAC,YAAK,OAAA,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,MAAA,MAAM,CAAC,CAAC,CAAC,mCAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,EAAA,EAAE,EAAe,CAAC,EAA1F,CAA0F,CAAC,CAAA;IACxH,IAAM,CAAC,GAAG,IAAA,eAAW,EAAC,MAAM,EAAE,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAArC,CAAqC,EAAE,EAAe,CAAC,CAAA;IAC/F,uCAAW,CAAC,UAAE,CAAC,UAAC;AAClB,CAAC;AALD,sBAKC"}
@@ -1,5 +1,5 @@
1
1
  import { NotExtendable } from './Extends';
2
- import { IsEmptyObject } from './isEmptyObject';
2
+ import { IsEmptyObject } from './IsEmptyObject';
3
3
  /**
4
4
  * Can `A` assign to `B`
5
5
  */
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=isEmptyObject.js.map
3
+ //# sourceMappingURL=IsEmptyObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IsEmptyObject.js","sourceRoot":"","sources":["../../ts/predicates/IsEmptyObject.ts"],"names":[],"mappings":""}
@@ -1,10 +1,10 @@
1
1
  export * from './CanAssign';
2
- export * from './Equal';
3
- export * from './Extends';
4
- export * from './If';
2
+ export type { Equal, IsEqual, IsNotEqual, NotEqual } from './Equal';
3
+ export type { Extendable, IsExtend, IsNotExtend, NotExtendable } from './Extends';
4
+ export type { If } from './If';
5
5
  export * from './isType';
6
- export * from './logical';
7
- export * from './isEmptyObject';
6
+ export type { And, Not, Or, Xor } from './logical';
7
+ export type { IsEmptyObject } from './IsEmptyObject';
8
8
  import { IsExtend } from './Extends';
9
9
  export declare type IsLiteral<T extends number | string, Then = true, Else = false> = number extends T ? Else : string extends T ? Else : Then;
10
10
  export declare type IsBoolean<T, Then = true, Else = false> = boolean extends T ? Then : Else;