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
@@ -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];
@@ -11,10 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
15
  };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
17
  __exportStar(require("./CanAssign"), exports);
14
- __exportStar(require("./Equal"), exports);
15
- __exportStar(require("./Extends"), exports);
16
- __exportStar(require("./If"), exports);
17
18
  __exportStar(require("./isType"), exports);
18
- __exportStar(require("./logical"), exports);
19
- __exportStar(require("./isEmptyObject"), exports);
20
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/predicates/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA2B;AAC3B,0CAAuB;AACvB,4CAAyB;AACzB,uCAAoB;AACpB,2CAAwB;AACxB,4CAAyB;AACzB,kDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/predicates/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAI3B,2CAAwB"}
@@ -1,4 +1,4 @@
1
1
  export * from './isPromise';
2
- export * from './PromiseValue';
3
- export * from './PromiseValueMerge';
2
+ export type { PromiseValue } from './PromiseValue';
3
+ export type { PromiseValueMerge } from './PromiseValueMerge';
4
4
  export * from './mapSeries';
@@ -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];
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/promise/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA2B;AAC3B,iDAA8B;AAC9B,sDAAmC;AACnC,8CAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/promise/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAG3B,8CAA2B"}
@@ -1,2 +1,2 @@
1
1
  export * from './as';
2
- export * from './Widen';
2
+ export type { Widen } from './Widen';
@@ -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];
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAoB;AACpB,0CAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uCAAoB"}
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/array/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/array/index.ts"],"names":[],"mappings":"AAWA,cAAc,gBAAgB,CAAA;AAE9B,cAAc,eAAe,CAAA"}
@@ -1,3 +1,2 @@
1
- export * from './AnyConstructor';
2
1
  export * from './isConstructor';
3
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/class/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/class/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAA"}
@@ -1,2 +1,2 @@
1
- export * from './AnyFunction';
1
+ export {};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/function/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/function/index.ts"],"names":[],"mappings":""}
@@ -1,3 +1,2 @@
1
- // export * from './Maybe'
2
- export * from './ChainFn';
1
+ export {};
3
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/functional/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/functional/index.ts"],"names":[],"mappings":""}
package/esm/index.js CHANGED
@@ -3,7 +3,6 @@ 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
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,mCAAmC;AACnC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAClD,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA;AACjC,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;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,WAAW,CAAA;AACzB,mCAAmC;AACnC,mCAAmC;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,+BAA+B"}
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
@@ -1,8 +1,2 @@
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 {};
8
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/math/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,OAAO,CAAA;AACrB,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,OAAO,CAAA;AACrB,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/math/index.ts"],"names":[],"mappings":""}
@@ -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,13 @@ 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';
16
+ export * from './split';
33
17
  export * from './typeOverrideIncompatible';
34
- export * from './ValueOf';
35
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/object/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,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;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,QAAQ,CAAA;AACtB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,WAAW,CAAA"}
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;AACzB,cAAc,SAAS,CAAA;AAEvB,cAAc,4BAA4B,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { reduceByKey } from '..';
2
+ export function split(target, ...splitters) {
3
+ const keyMap = {};
4
+ const s = splitters.map(s => reduceByKey(s, (p, k) => (keyMap[k] = true, p[k] = target[k] ?? s[k], p), {}));
5
+ const r = reduceByKey(target, (p, k) => keyMap[k] ? p : (p[k] = target[k], p), {});
6
+ return [...s, r];
7
+ }
8
+ //# sourceMappingURL=split.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split.js","sourceRoot":"","sources":["../../ts/object/split.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,WAAW,EAAE,MAAM,IAAI,CAAA;AAyLjD,MAAM,UAAU,KAAK,CAAC,MAAiB,EAAE,GAAG,SAAsB;IAChE,MAAM,MAAM,GAAc,EAAE,CAAA;IAC5B,MAAM,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAe,CAAC,CAAC,CAAA;IACxH,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAe,CAAC,CAAA;IAC/F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;AAClB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IsEmptyObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IsEmptyObject.js","sourceRoot":"","sources":["../../ts/predicates/IsEmptyObject.ts"],"names":[],"mappings":""}
@@ -1,8 +1,3 @@
1
1
  export * from './CanAssign';
2
- export * from './Equal';
3
- export * from './Extends';
4
- export * from './If';
5
2
  export * from './isType';
6
- export * from './logical';
7
- export * from './isEmptyObject';
8
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/predicates/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,MAAM,CAAA;AACpB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/predicates/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAI3B,cAAc,UAAU,CAAA"}
@@ -1,5 +1,3 @@
1
1
  export * from './isPromise';
2
- export * from './PromiseValue';
3
- export * from './PromiseValueMerge';
4
2
  export * from './mapSeries';
5
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/promise/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,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"}
@@ -1,3 +1,2 @@
1
1
  export * from './as';
2
- export * from './Widen';
3
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA;AACpB,cAAc,SAAS,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": "4.0.0",
3
+ "version": "4.1.0",
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
- "verify": "run-p verify:build lint coverage",
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.0",
54
+ "tersify": "^3.8.2",
54
55
  "unpartial": "^0.6.4"
55
56
  },
56
57
  "devDependencies": {
57
- "@babel/core": "^7.16.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.7",
62
+ "@babel/preset-env": "^7.16.11",
62
63
  "@babel/preset-typescript": "^7.16.7",
63
- "@commitlint/cli": "^16.0.1",
64
- "@commitlint/config-conventional": "^16.0.0",
65
- "@size-limit/preset-small-lib": "^7.0.5",
66
- "@types/jest": "^27.4.0",
67
- "@unional/fixture": "^1.7.2",
68
- "assertron": "^9.0.0",
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.6.0",
72
+ "eslint": "^8.11.0",
71
73
  "eslint-plugin-harmony": "^6.0.0",
72
74
  "husky": "^7.0.4",
73
- "jest": "^27.4.5",
74
- "jest-progress-tracker": "^3.0.1",
75
- "jest-validate": "^27.4.2",
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.1",
83
- "size-limit": "^7.0.5",
84
- "typescript": "^4.5.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 * 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
- export * from './literalArray'
13
- export * from './PadLeft'
14
- export * from './reduceWhile'
15
- export * from './Reverse'
16
- export * from './Some'
17
- export * from './Tail'
18
- export * from './UnionOfProps'
19
- export * from './UnionOfValues'
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'
@@ -1 +1 @@
1
- export * from './Bit'
1
+ export type { Bit, BitAnd, BitNot, BitOr, BitXor } from './Bit'
package/ts/class/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './AnyConstructor'
1
+ export type { AnyConstructor } from './AnyConstructor'
2
2
  export * from './isConstructor'
@@ -1 +1 @@
1
- export * from './AnyFunction'
1
+ export type { AnyFunction } from './AnyFunction'
@@ -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
@@ -1,2 +1,2 @@
1
- // export * from './Maybe'
2
- export * from './ChainFn'
1
+ // export * from './Maybe'
2
+ export type { ChainFn, EndoFn } from './ChainFn'
package/ts/index.spec.ts CHANGED
@@ -1,5 +1,7 @@
1
- import { T, types } from '.'
1
+ // import { T, types } from '.'
2
2
 
3
- test('export types also as T', () => {
4
- expect(T).toBe(types)
5
- })
3
+ // test('export types also as T', () => {
4
+ // expect(T).toBe(types)
5
+ // })
6
+
7
+ test.todo('no test')
package/ts/index.ts CHANGED
@@ -3,7 +3,7 @@ export { required, requiredDeep } from 'unpartial'
3
3
  export * from './array'
4
4
  export * from './assertion'
5
5
  export * from './class'
6
- export * from './ComposableTypes'
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 * from './PrimitiveTypes'
15
+ export type { PrimitiveTypes } from './PrimitiveTypes'
16
16
  export * from './promise'
17
17
  // export * from './types/optional'
18
18
  // export * from './types/required'
19
- export * from './UnionKeys'
19
+ export type { UnionKeys } from './UnionKeys'
20
20
  export * from './utils'
21
21
  // export { types, types as T }
package/ts/math/index.ts CHANGED
@@ -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'
@@ -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
+ })