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.
Files changed (210) hide show
  1. package/README.md +1 -55
  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 -7
  17. package/cjs/index.js +8 -22
  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 +18 -18
  27. package/cjs/object/index.js +5 -19
  28. package/cjs/object/index.js.map +1 -1
  29. package/cjs/predicates/CanAssign.d.ts +1 -1
  30. package/cjs/predicates/{isEmptyObject.d.ts → IsEmptyObject.d.ts} +0 -0
  31. package/cjs/{types/AllType.js → predicates/IsEmptyObject.js} +1 -1
  32. package/cjs/predicates/IsEmptyObject.js.map +1 -0
  33. package/cjs/predicates/index.d.ts +5 -5
  34. package/cjs/predicates/index.js +5 -6
  35. package/cjs/predicates/index.js.map +1 -1
  36. package/cjs/promise/index.d.ts +2 -2
  37. package/cjs/promise/index.js +5 -3
  38. package/cjs/promise/index.js.map +1 -1
  39. package/cjs/utils/index.d.ts +1 -1
  40. package/cjs/utils/index.js +5 -2
  41. package/cjs/utils/index.js.map +1 -1
  42. package/esm/array/index.js +0 -17
  43. package/esm/array/index.js.map +1 -1
  44. package/esm/class/index.js +0 -1
  45. package/esm/class/index.js.map +1 -1
  46. package/esm/function/index.js +1 -1
  47. package/esm/function/index.js.map +1 -1
  48. package/esm/functional/index.js +1 -2
  49. package/esm/functional/index.js.map +1 -1
  50. package/esm/index.js +2 -7
  51. package/esm/index.js.map +1 -1
  52. package/esm/math/index.js +1 -7
  53. package/esm/math/index.js.map +1 -1
  54. package/esm/object/index.js +0 -18
  55. package/esm/object/index.js.map +1 -1
  56. package/esm/predicates/IsEmptyObject.js +2 -0
  57. package/esm/predicates/IsEmptyObject.js.map +1 -0
  58. package/esm/predicates/index.js +0 -5
  59. package/esm/predicates/index.js.map +1 -1
  60. package/esm/promise/index.js +0 -2
  61. package/esm/promise/index.js.map +1 -1
  62. package/esm/utils/index.js +0 -1
  63. package/esm/utils/index.js.map +1 -1
  64. package/package.json +20 -18
  65. package/ts/array/index.ts +19 -19
  66. package/ts/binary/_binary.ts +1 -1
  67. package/ts/class/index.ts +1 -1
  68. package/ts/function/index.ts +1 -1
  69. package/ts/functional/ChainFn.ts +6 -6
  70. package/ts/functional/index.ts +2 -2
  71. package/ts/index.spec.ts +6 -4
  72. package/ts/index.ts +7 -7
  73. package/ts/math/index.ts +7 -7
  74. package/ts/object/Partial.spec.ts +49 -49
  75. package/ts/object/index.ts +35 -35
  76. package/ts/predicates/CanAssign.ts +1 -1
  77. package/ts/predicates/{isEmptyObject.spec.ts → IsEmptyObject.spec.ts} +0 -0
  78. package/ts/predicates/{isEmptyObject.ts → IsEmptyObject.ts} +0 -0
  79. package/ts/predicates/index.ts +17 -17
  80. package/ts/promise/index.ts +2 -2
  81. package/ts/type-checker/typeChecker.spec.ts +2 -1
  82. package/ts/types/check.spec.ts +1 -1
  83. package/ts/types/conform.spec.ts +1 -1
  84. package/ts/types/index.ts +28 -28
  85. package/ts/types/satisfy.accept.ts +39 -38
  86. package/ts/types/satisfy.spec.ts +2 -1
  87. package/ts/utils/index.ts +2 -2
  88. package/cjs/predicates/isEmptyObject.js +0 -3
  89. package/cjs/predicates/isEmptyObject.js.map +0 -1
  90. package/cjs/types/AllType.d.ts +0 -18
  91. package/cjs/types/AllType.js.map +0 -1
  92. package/cjs/types/Any.d.ts +0 -6
  93. package/cjs/types/Any.js +0 -5
  94. package/cjs/types/Any.js.map +0 -1
  95. package/cjs/types/Array.d.ts +0 -28
  96. package/cjs/types/Array.js +0 -30
  97. package/cjs/types/Array.js.map +0 -1
  98. package/cjs/types/Boolean.d.ts +0 -29
  99. package/cjs/types/Boolean.js +0 -28
  100. package/cjs/types/Boolean.js.map +0 -1
  101. package/cjs/types/Generate.d.ts +0 -32
  102. package/cjs/types/Generate.js +0 -3
  103. package/cjs/types/Generate.js.map +0 -1
  104. package/cjs/types/Null.d.ts +0 -8
  105. package/cjs/types/Null.js +0 -10
  106. package/cjs/types/Null.js.map +0 -1
  107. package/cjs/types/Number.d.ts +0 -36
  108. package/cjs/types/Number.js +0 -50
  109. package/cjs/types/Number.js.map +0 -1
  110. package/cjs/types/Object.d.ts +0 -313
  111. package/cjs/types/Object.js +0 -35
  112. package/cjs/types/Object.js.map +0 -1
  113. package/cjs/types/Record.d.ts +0 -16
  114. package/cjs/types/Record.js +0 -17
  115. package/cjs/types/Record.js.map +0 -1
  116. package/cjs/types/String.d.ts +0 -36
  117. package/cjs/types/String.js +0 -51
  118. package/cjs/types/String.js.map +0 -1
  119. package/cjs/types/Symbol.d.ts +0 -8
  120. package/cjs/types/Symbol.js +0 -13
  121. package/cjs/types/Symbol.js.map +0 -1
  122. package/cjs/types/Tuple.d.ts +0 -35
  123. package/cjs/types/Tuple.js +0 -43
  124. package/cjs/types/Tuple.js.map +0 -1
  125. package/cjs/types/Undefined.d.ts +0 -6
  126. package/cjs/types/Undefined.js +0 -5
  127. package/cjs/types/Undefined.js.map +0 -1
  128. package/cjs/types/Union.d.ts +0 -20
  129. package/cjs/types/Union.js +0 -52
  130. package/cjs/types/Union.js.map +0 -1
  131. package/cjs/types/Unknown.d.ts +0 -6
  132. package/cjs/types/Unknown.js +0 -5
  133. package/cjs/types/Unknown.js.map +0 -1
  134. package/cjs/types/analyze.d.ts +0 -13
  135. package/cjs/types/analyze.js +0 -159
  136. package/cjs/types/analyze.js.map +0 -1
  137. package/cjs/types/check.d.ts +0 -14
  138. package/cjs/types/check.js +0 -25
  139. package/cjs/types/check.js.map +0 -1
  140. package/cjs/types/conform.d.ts +0 -15
  141. package/cjs/types/conform.js +0 -26
  142. package/cjs/types/conform.js.map +0 -1
  143. package/cjs/types/getPlainAnalysisReport.d.ts +0 -2
  144. package/cjs/types/getPlainAnalysisReport.js +0 -120
  145. package/cjs/types/getPlainAnalysisReport.js.map +0 -1
  146. package/cjs/types/index.d.ts +0 -26
  147. package/cjs/types/index.js +0 -45
  148. package/cjs/types/index.js.map +0 -1
  149. package/cjs/types/optional.d.ts +0 -328
  150. package/cjs/types/optional.js +0 -33
  151. package/cjs/types/optional.js.map +0 -1
  152. package/cjs/types/required.d.ts +0 -664
  153. package/cjs/types/required.js +0 -33
  154. package/cjs/types/required.js.map +0 -1
  155. package/cjs/types/satisfy.d.ts +0 -15
  156. package/cjs/types/satisfy.js +0 -26
  157. package/cjs/types/satisfy.js.map +0 -1
  158. package/cjs/types/types.d.ts +0 -9
  159. package/cjs/types/types.js +0 -3
  160. package/cjs/types/types.js.map +0 -1
  161. package/esm/predicates/isEmptyObject.js +0 -2
  162. package/esm/predicates/isEmptyObject.js.map +0 -1
  163. package/esm/types/AllType.js +0 -2
  164. package/esm/types/AllType.js.map +0 -1
  165. package/esm/types/Any.js +0 -2
  166. package/esm/types/Any.js.map +0 -1
  167. package/esm/types/Array.js +0 -27
  168. package/esm/types/Array.js.map +0 -1
  169. package/esm/types/Boolean.js +0 -25
  170. package/esm/types/Boolean.js.map +0 -1
  171. package/esm/types/Generate.js +0 -2
  172. package/esm/types/Generate.js.map +0 -1
  173. package/esm/types/Null.js +0 -7
  174. package/esm/types/Null.js.map +0 -1
  175. package/esm/types/Number.js +0 -30
  176. package/esm/types/Number.js.map +0 -1
  177. package/esm/types/Object.js +0 -31
  178. package/esm/types/Object.js.map +0 -1
  179. package/esm/types/Record.js +0 -14
  180. package/esm/types/Record.js.map +0 -1
  181. package/esm/types/String.js +0 -31
  182. package/esm/types/String.js.map +0 -1
  183. package/esm/types/Symbol.js +0 -10
  184. package/esm/types/Symbol.js.map +0 -1
  185. package/esm/types/Tuple.js +0 -23
  186. package/esm/types/Tuple.js.map +0 -1
  187. package/esm/types/Undefined.js +0 -2
  188. package/esm/types/Undefined.js.map +0 -1
  189. package/esm/types/Union.js +0 -32
  190. package/esm/types/Union.js.map +0 -1
  191. package/esm/types/Unknown.js +0 -2
  192. package/esm/types/Unknown.js.map +0 -1
  193. package/esm/types/analyze.js +0 -142
  194. package/esm/types/analyze.js.map +0 -1
  195. package/esm/types/check.js +0 -21
  196. package/esm/types/check.js.map +0 -1
  197. package/esm/types/conform.js +0 -22
  198. package/esm/types/conform.js.map +0 -1
  199. package/esm/types/getPlainAnalysisReport.js +0 -106
  200. package/esm/types/getPlainAnalysisReport.js.map +0 -1
  201. package/esm/types/index.js +0 -28
  202. package/esm/types/index.js.map +0 -1
  203. package/esm/types/optional.js +0 -30
  204. package/esm/types/optional.js.map +0 -1
  205. package/esm/types/required.js +0 -30
  206. package/esm/types/required.js.map +0 -1
  207. package/esm/types/satisfy.js +0 -22
  208. package/esm/types/satisfy.js.map +0 -1
  209. package/esm/types/types.js +0 -2
  210. package/esm/types/types.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,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
@@ -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,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,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,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,CAAC,EAAE,CAAA"}
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,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
@@ -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;AAEzB,cAAc,4BAA4B,CAAA"}
@@ -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": "3.15.0",
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
- "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
@@ -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 * 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
- export * from './types/optional'
18
- export * from './types/required'
19
- export * from './UnionKeys'
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 * 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
+ })
@@ -1,35 +1,35 @@
1
- export * from '../object/IsDisjoint'
2
- export * from './ANotB'
3
- export * from './AnyRecord'
4
- export * from './everyKey'
5
- export * from './ExcludePropType'
6
- export * from './facade'
7
- export * from './filterKey'
8
- export * from './findKey'
9
- export * from './forEachKey'
10
- export * from './getField'
11
- export * from './hasKey'
12
- export * from './hasProperty'
13
- export * from './IsRecord'
14
- export * from './KeyofOptional'
15
- export * from './KeysWithDiffType'
16
- export * from './KeyTypes'
17
- export * from './KnownKeys'
18
- export * from './mapKey'
19
- export * from './mapProperties'
20
- export * from './omit'
21
- export * from './OptionalKeys'
22
- export * from './Partial'
23
- export * from './pick'
24
- export * from './RecursiveIntersect'
25
- export * from './RecursivePartial'
26
- export * from './RecursiveRequired'
27
- export * from './reduceKey'
28
- export * from './replaceProperty'
29
- export * from './Required'
30
- export * from './RequiredKeys'
31
- export * from './someKey'
32
- export * from './SpreadRecord'
33
- export * from './typeOverrideIncompatible'
34
- export * from './ValueOf'
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
+