@stryke/types 0.5.1 → 0.6.1

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 (226) hide show
  1. package/README.md +16 -14
  2. package/dist/{utility-types/array.d.ts → array.d.ts} +0 -12
  3. package/dist/{utility-types/async.d.ts → async.d.ts} +1 -11
  4. package/dist/{utility-types/base.d.ts → base.d.ts} +23 -31
  5. package/dist/index.cjs +181 -16
  6. package/dist/index.d.ts +19 -4
  7. package/dist/index.mjs +1 -1
  8. package/dist/{utility-types/json.d.ts → json.d.ts} +0 -10
  9. package/dist/{utility-types/number.d.ts → number.d.ts} +0 -22
  10. package/dist/{utility-types/object.d.ts → object.d.ts} +1 -15
  11. package/dist/{utility-types/package-json.d.ts → package-json.d.ts} +3 -5
  12. package/dist/{utility-types/string.d.ts → string.d.ts} +0 -12
  13. package/dist/{utility-types/tsconfig.d.ts → tsconfig.d.ts} +0 -2
  14. package/dist/{utility-types/utilities.d.ts → utilities.d.ts} +1 -1
  15. package/dist/validations.cjs +1 -0
  16. package/dist/validations.mjs +0 -0
  17. package/package.json +125 -987
  18. package/dist/convert/buffer-to-string.cjs +0 -8
  19. package/dist/convert/buffer-to-string.d.ts +0 -1
  20. package/dist/convert/buffer-to-string.mjs +0 -1
  21. package/dist/convert/index.cjs +0 -71
  22. package/dist/convert/index.d.ts +0 -6
  23. package/dist/convert/index.mjs +0 -1
  24. package/dist/convert/string-to-uint8-array.cjs +0 -8
  25. package/dist/convert/string-to-uint8-array.d.ts +0 -7
  26. package/dist/convert/string-to-uint8-array.mjs +0 -1
  27. package/dist/convert/to-array.cjs +0 -9
  28. package/dist/convert/to-array.d.ts +0 -8
  29. package/dist/convert/to-array.mjs +0 -1
  30. package/dist/convert/to-string-key.cjs +0 -9
  31. package/dist/convert/to-string-key.d.ts +0 -7
  32. package/dist/convert/to-string-key.mjs +0 -1
  33. package/dist/convert/uint8-array-to-string.cjs +0 -8
  34. package/dist/convert/uint8-array-to-string.d.ts +0 -13
  35. package/dist/convert/uint8-array-to-string.mjs +0 -1
  36. package/dist/convert/utf8-array-to-string.cjs +0 -8
  37. package/dist/convert/utf8-array-to-string.d.ts +0 -13
  38. package/dist/convert/utf8-array-to-string.mjs +0 -1
  39. package/dist/helpers/index.cjs +0 -16
  40. package/dist/helpers/index.d.ts +0 -1
  41. package/dist/helpers/index.mjs +0 -1
  42. package/dist/helpers/parse-type-definition.cjs +0 -33
  43. package/dist/helpers/parse-type-definition.d.ts +0 -8
  44. package/dist/helpers/parse-type-definition.mjs +0 -1
  45. package/dist/type-checks/get-object-tag.cjs +0 -8
  46. package/dist/type-checks/get-object-tag.d.ts +0 -7
  47. package/dist/type-checks/get-object-tag.mjs +0 -1
  48. package/dist/type-checks/index.cjs +0 -456
  49. package/dist/type-checks/index.d.ts +0 -41
  50. package/dist/type-checks/index.mjs +0 -1
  51. package/dist/type-checks/is-array-like.cjs +0 -11
  52. package/dist/type-checks/is-array-like.d.ts +0 -7
  53. package/dist/type-checks/is-array-like.mjs +0 -1
  54. package/dist/type-checks/is-async-iterable.cjs +0 -10
  55. package/dist/type-checks/is-async-iterable.d.ts +0 -7
  56. package/dist/type-checks/is-async-iterable.mjs +0 -1
  57. package/dist/type-checks/is-bigint.cjs +0 -9
  58. package/dist/type-checks/is-bigint.d.ts +0 -16
  59. package/dist/type-checks/is-bigint.mjs +0 -1
  60. package/dist/type-checks/is-boolean.cjs +0 -14
  61. package/dist/type-checks/is-boolean.d.ts +0 -7
  62. package/dist/type-checks/is-boolean.mjs +0 -1
  63. package/dist/type-checks/is-buffer.cjs +0 -10
  64. package/dist/type-checks/is-buffer.d.ts +0 -5
  65. package/dist/type-checks/is-buffer.mjs +0 -1
  66. package/dist/type-checks/is-collection.cjs +0 -11
  67. package/dist/type-checks/is-collection.d.ts +0 -8
  68. package/dist/type-checks/is-collection.mjs +0 -1
  69. package/dist/type-checks/is-date.cjs +0 -10
  70. package/dist/type-checks/is-date.d.ts +0 -16
  71. package/dist/type-checks/is-date.mjs +0 -1
  72. package/dist/type-checks/is-deep-key.cjs +0 -26
  73. package/dist/type-checks/is-deep-key.d.ts +0 -35
  74. package/dist/type-checks/is-deep-key.mjs +0 -1
  75. package/dist/type-checks/is-empty-object.cjs +0 -23
  76. package/dist/type-checks/is-empty-object.d.ts +0 -14
  77. package/dist/type-checks/is-empty-object.mjs +0 -1
  78. package/dist/type-checks/is-empty-string.cjs +0 -16
  79. package/dist/type-checks/is-empty-string.d.ts +0 -7
  80. package/dist/type-checks/is-empty-string.mjs +0 -1
  81. package/dist/type-checks/is-empty.cjs +0 -35
  82. package/dist/type-checks/is-empty.d.ts +0 -8
  83. package/dist/type-checks/is-empty.mjs +0 -1
  84. package/dist/type-checks/is-equal.cjs +0 -18
  85. package/dist/type-checks/is-equal.d.ts +0 -1
  86. package/dist/type-checks/is-equal.mjs +0 -1
  87. package/dist/type-checks/is-error.cjs +0 -15
  88. package/dist/type-checks/is-error.d.ts +0 -17
  89. package/dist/type-checks/is-error.mjs +0 -1
  90. package/dist/type-checks/is-file-result.cjs +0 -11
  91. package/dist/type-checks/is-file-result.d.ts +0 -8
  92. package/dist/type-checks/is-file-result.mjs +0 -1
  93. package/dist/type-checks/is-float.cjs +0 -9
  94. package/dist/type-checks/is-float.d.ts +0 -8
  95. package/dist/type-checks/is-float.mjs +0 -1
  96. package/dist/type-checks/is-function.cjs +0 -23
  97. package/dist/type-checks/is-function.d.ts +0 -10
  98. package/dist/type-checks/is-function.mjs +0 -1
  99. package/dist/type-checks/is-integer.cjs +0 -10
  100. package/dist/type-checks/is-integer.d.ts +0 -8
  101. package/dist/type-checks/is-integer.mjs +0 -1
  102. package/dist/type-checks/is-mergeable-object.cjs +0 -14
  103. package/dist/type-checks/is-mergeable-object.d.ts +0 -1
  104. package/dist/type-checks/is-mergeable-object.mjs +0 -1
  105. package/dist/type-checks/is-non-null-object.cjs +0 -10
  106. package/dist/type-checks/is-non-null-object.d.ts +0 -7
  107. package/dist/type-checks/is-non-null-object.mjs +0 -1
  108. package/dist/type-checks/is-not-empty.cjs +0 -17
  109. package/dist/type-checks/is-not-empty.d.ts +0 -7
  110. package/dist/type-checks/is-not-empty.mjs +0 -1
  111. package/dist/type-checks/is-null.cjs +0 -14
  112. package/dist/type-checks/is-null.d.ts +0 -1
  113. package/dist/type-checks/is-null.mjs +0 -1
  114. package/dist/type-checks/is-number.cjs +0 -19
  115. package/dist/type-checks/is-number.d.ts +0 -15
  116. package/dist/type-checks/is-number.mjs +0 -1
  117. package/dist/type-checks/is-object-index.cjs +0 -17
  118. package/dist/type-checks/is-object-index.d.ts +0 -7
  119. package/dist/type-checks/is-object-index.mjs +0 -1
  120. package/dist/type-checks/is-object.cjs +0 -30
  121. package/dist/type-checks/is-object.d.ts +0 -30
  122. package/dist/type-checks/is-object.mjs +0 -1
  123. package/dist/type-checks/is-plain-object.cjs +0 -17
  124. package/dist/type-checks/is-plain-object.d.ts +0 -50
  125. package/dist/type-checks/is-plain-object.mjs +0 -1
  126. package/dist/type-checks/is-primitive.cjs +0 -14
  127. package/dist/type-checks/is-primitive.d.ts +0 -1
  128. package/dist/type-checks/is-primitive.mjs +0 -1
  129. package/dist/type-checks/is-promise.cjs +0 -12
  130. package/dist/type-checks/is-promise.d.ts +0 -17
  131. package/dist/type-checks/is-promise.mjs +0 -1
  132. package/dist/type-checks/is-react-element.cjs +0 -8
  133. package/dist/type-checks/is-react-element.d.ts +0 -1
  134. package/dist/type-checks/is-react-element.mjs +0 -1
  135. package/dist/type-checks/is-ref.cjs +0 -14
  136. package/dist/type-checks/is-ref.d.ts +0 -8
  137. package/dist/type-checks/is-ref.mjs +0 -1
  138. package/dist/type-checks/is-regexp.cjs +0 -10
  139. package/dist/type-checks/is-regexp.d.ts +0 -16
  140. package/dist/type-checks/is-regexp.mjs +0 -1
  141. package/dist/type-checks/is-select-option.cjs +0 -15
  142. package/dist/type-checks/is-select-option.d.ts +0 -8
  143. package/dist/type-checks/is-select-option.mjs +0 -1
  144. package/dist/type-checks/is-set-object.cjs +0 -15
  145. package/dist/type-checks/is-set-object.d.ts +0 -7
  146. package/dist/type-checks/is-set-object.mjs +0 -1
  147. package/dist/type-checks/is-set-string.cjs +0 -16
  148. package/dist/type-checks/is-set-string.d.ts +0 -7
  149. package/dist/type-checks/is-set-string.mjs +0 -1
  150. package/dist/type-checks/is-set.cjs +0 -15
  151. package/dist/type-checks/is-set.d.ts +0 -7
  152. package/dist/type-checks/is-set.mjs +0 -1
  153. package/dist/type-checks/is-string.cjs +0 -14
  154. package/dist/type-checks/is-string.d.ts +0 -1
  155. package/dist/type-checks/is-string.mjs +0 -1
  156. package/dist/type-checks/is-symbol.cjs +0 -14
  157. package/dist/type-checks/is-symbol.d.ts +0 -1
  158. package/dist/type-checks/is-symbol.mjs +0 -1
  159. package/dist/type-checks/is-typed-array.cjs +0 -9
  160. package/dist/type-checks/is-typed-array.d.ts +0 -1
  161. package/dist/type-checks/is-typed-array.mjs +0 -1
  162. package/dist/type-checks/is-typed.cjs +0 -16
  163. package/dist/type-checks/is-typed.d.ts +0 -8
  164. package/dist/type-checks/is-typed.mjs +0 -1
  165. package/dist/type-checks/is-undefined.cjs +0 -8
  166. package/dist/type-checks/is-undefined.d.ts +0 -1
  167. package/dist/type-checks/is-undefined.mjs +0 -1
  168. package/dist/type-checks/property-exists.cjs +0 -17
  169. package/dist/type-checks/property-exists.d.ts +0 -16
  170. package/dist/type-checks/property-exists.mjs +0 -1
  171. package/dist/type-checks/type-detect.cjs +0 -38
  172. package/dist/type-checks/type-detect.d.ts +0 -1
  173. package/dist/type-checks/type-detect.mjs +0 -1
  174. package/dist/utility-types/array.cjs +0 -9
  175. package/dist/utility-types/array.mjs +0 -1
  176. package/dist/utility-types/index.cjs +0 -214
  177. package/dist/utility-types/index.d.ts +0 -19
  178. package/dist/utility-types/index.mjs +0 -1
  179. /package/dist/{utility-types/async.cjs → array.cjs} +0 -0
  180. /package/dist/{utility-types/async.mjs → array.mjs} +0 -0
  181. /package/dist/{utility-types/configuration.cjs → async.cjs} +0 -0
  182. /package/dist/{utility-types/configuration.mjs → async.mjs} +0 -0
  183. /package/dist/{utility-types/base.cjs → base.cjs} +0 -0
  184. /package/dist/{utility-types/base.mjs → base.mjs} +0 -0
  185. /package/dist/{utility-types/form.cjs → configuration.cjs} +0 -0
  186. /package/dist/{utility-types/configuration.d.ts → configuration.d.ts} +0 -0
  187. /package/dist/{utility-types/form.mjs → configuration.mjs} +0 -0
  188. /package/dist/{utility-types/file.cjs → file.cjs} +0 -0
  189. /package/dist/{utility-types/file.d.ts → file.d.ts} +0 -0
  190. /package/dist/{utility-types/file.mjs → file.mjs} +0 -0
  191. /package/dist/{utility-types/json.cjs → form.cjs} +0 -0
  192. /package/dist/{utility-types/form.d.ts → form.d.ts} +0 -0
  193. /package/dist/{utility-types/json.mjs → form.mjs} +0 -0
  194. /package/dist/{utility-types/logic.cjs → json.cjs} +0 -0
  195. /package/dist/{utility-types/logic.mjs → json.mjs} +0 -0
  196. /package/dist/{utility-types/navigator.cjs → logic.cjs} +0 -0
  197. /package/dist/{utility-types/logic.d.ts → logic.d.ts} +0 -0
  198. /package/dist/{utility-types/navigator.mjs → logic.mjs} +0 -0
  199. /package/dist/{utility-types/messages.cjs → messages.cjs} +0 -0
  200. /package/dist/{utility-types/messages.d.ts → messages.d.ts} +0 -0
  201. /package/dist/{utility-types/messages.mjs → messages.mjs} +0 -0
  202. /package/dist/{utility-types/number.cjs → navigator.cjs} +0 -0
  203. /package/dist/{utility-types/navigator.d.ts → navigator.d.ts} +0 -0
  204. /package/dist/{utility-types/number.mjs → navigator.mjs} +0 -0
  205. /package/dist/{utility-types/object.cjs → number.cjs} +0 -0
  206. /package/dist/{utility-types/object.mjs → number.mjs} +0 -0
  207. /package/dist/{utility-types/package-json.cjs → object.cjs} +0 -0
  208. /package/dist/{utility-types/package-json.mjs → object.mjs} +0 -0
  209. /package/dist/{utility-types/string.cjs → package-json.cjs} +0 -0
  210. /package/dist/{utility-types/string.mjs → package-json.mjs} +0 -0
  211. /package/dist/{utility-types/package-manager.cjs → package-manager.cjs} +0 -0
  212. /package/dist/{utility-types/package-manager.d.ts → package-manager.d.ts} +0 -0
  213. /package/dist/{utility-types/package-manager.mjs → package-manager.mjs} +0 -0
  214. /package/dist/{utility-types/system.cjs → string.cjs} +0 -0
  215. /package/dist/{utility-types/system.mjs → string.mjs} +0 -0
  216. /package/dist/{utility-types/tsconfig.cjs → system.cjs} +0 -0
  217. /package/dist/{utility-types/system.d.ts → system.d.ts} +0 -0
  218. /package/dist/{utility-types/tsconfig.mjs → system.mjs} +0 -0
  219. /package/dist/{utility-types/utilities.cjs → tsconfig.cjs} +0 -0
  220. /package/dist/{utility-types/utilities.mjs → tsconfig.mjs} +0 -0
  221. /package/dist/{utility-types/user.cjs → user.cjs} +0 -0
  222. /package/dist/{utility-types/user.d.ts → user.d.ts} +0 -0
  223. /package/dist/{utility-types/user.mjs → user.mjs} +0 -0
  224. /package/dist/{utility-types/validations.cjs → utilities.cjs} +0 -0
  225. /package/dist/{utility-types/validations.mjs → utilities.mjs} +0 -0
  226. /package/dist/{utility-types/validations.d.ts → validations.d.ts} +0 -0
@@ -68,8 +68,6 @@ export type LiteralKeyOf<T> = keyof {
68
68
  * const pet: Pet2 = '';
69
69
  * // You **will** get auto-completion for `dog` and `cat` literals.
70
70
  * ```
71
- *
72
- * @category Type
73
71
  */
74
72
  export type LiteralUnion<LiteralType, BaseType extends Primitive> = (BaseType & Record<never, never>) | LiteralType;
75
73
  /**
@@ -155,9 +153,6 @@ type StrictPropertyOf<BaseType, Key extends keyof BaseType, Options extends GetO
155
153
  *
156
154
  * array = split(items, ',');
157
155
  * ```
158
- *
159
- * @category String
160
- * @category Template literal
161
156
  */
162
157
  export type Split<S extends string, Delimiter extends string> = S extends `${infer Head}${Delimiter}${infer Tail}` ? [Head, ...Split<Tail, Delimiter>] : S extends Delimiter ? [] : [S];
163
158
  /**
@@ -174,7 +169,7 @@ export type Split<S extends string, Delimiter extends string> = S extends `${inf
174
169
  */
175
170
  export type ToPath<S extends string> = Split<FixPathSquareBrackets<S>, ".">;
176
171
  /**
177
- * Replaces square-bracketed dot notation with dots, for example, `foo[0].bar` -> `foo.0.bar`.
172
+ * Replaces square-bracketed dot notation with dots, for example, `foo[0].bar` -\> `foo.0.bar`.
178
173
  */
179
174
  type FixPathSquareBrackets<Path extends string> = Path extends `[${infer Head}]${infer Tail}` ? Tail extends `[${string}` ? `${Head}.${FixPathSquareBrackets<Tail>}` : `${Head}${FixPathSquareBrackets<Tail>}` : Path extends `${infer Head}[${infer Middle}]${infer Tail}` ? `${Head}.${FixPathSquareBrackets<`[${Middle}]${Tail}`>}` : Path;
180
175
  /**
@@ -267,10 +262,6 @@ type PropertyOf<BaseType, Key extends string, Options extends GetOptions = {}> =
267
262
  * Get<string[], '3', {strict: false}> //=> string
268
263
  * Get<Record<string, string>, 'foo', {strict: true}> // => string
269
264
  * ```
270
- *
271
- * @category Object
272
- * @category Array
273
- * @category Template literal
274
265
  */
275
266
  export type Get<BaseType, Path extends readonly string[] | string, Options extends GetOptions = NonNullable<unknown>> = GetWithPath<BaseType, Path extends string ? ToPath<Path> : Path, Options>;
276
267
  /**
@@ -315,8 +306,6 @@ export type Get<BaseType, Path extends readonly string[] | string, Options exten
315
306
  * type Intersection = UnionToIntersection<Union>;
316
307
  * //=> {a1(): void; b1(): void; a2(argA: string): void; b2(argB: string): void}
317
308
  * ```
318
- *
319
- * @category Type
320
309
  */
321
310
  export type UnionToIntersection<Union> = (Union extends unknown ? (_distributedUnion: Union) => void : never) extends (_mergedIntersection: infer Intersection) => void ? // The `& Union` is to allow indexing by the resulting type
322
311
  Intersection & Union : never;
@@ -387,9 +376,6 @@ Intersection & Union : never;
387
376
  * // };
388
377
  * // }
389
378
  * ```
390
- *
391
- * @category Object
392
- * @category Array
393
379
  */
394
380
  export type PickDeep<T, PathUnion extends Paths<T>> = T extends NonRecursiveType ? never : T extends UnknownArray ? UnionToIntersection<{
395
381
  [P in PathUnion]: InternalPickDeep<T, P>;
@@ -128,8 +128,7 @@ export interface PackageJson {
128
128
  * Docs:
129
129
  * - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_package_json_type_field
130
130
  *
131
- * @default 'commonjs'
132
- * @since Node.js v14
131
+ * @defaultValue 'commonjs'
133
132
  */
134
133
  type?: "module" | "commonjs";
135
134
  /**
@@ -139,8 +138,6 @@ export interface PackageJson {
139
138
  *
140
139
  * Docs:
141
140
  * - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_exports_sugar
142
- *
143
- * @since Node.js v12.7
144
141
  */
145
142
  exports?: PackageJsonExports;
146
143
  /**
@@ -234,7 +231,8 @@ export interface PackageJson {
234
231
  *
235
232
  * When set to `true`, the project will be symlinked from the
236
233
  * `publishConfig.directory` location during local development.
237
- * @default true
234
+ *
235
+ * @defaultValue true
238
236
  */
239
237
  linkDirectory?: boolean;
240
238
  } & Pick<PackageJson, "bin" | "main" | "exports" | "types" | "typings" | "module" | "browser" | "unpkg" | "typesVersions" | "os" | "cpu">;
@@ -22,10 +22,6 @@ import type { NegativeInfinity, PositiveInfinity } from "./number";
22
22
  * type NegativeInfinity = StringToNumber<'-Infinity'>;
23
23
  * //=> -Infinity
24
24
  * ```
25
- *
26
- * @category String
27
- * @category Numeric
28
- * @category Template literal
29
25
  */
30
26
  export type StringToNumber<S extends string> = S extends `${infer N extends number}` ? N : S extends "Infinity" ? PositiveInfinity : S extends "-Infinity" ? NegativeInfinity : never;
31
27
  /**
@@ -45,9 +41,6 @@ export type StringToNumber<S extends string> = S extends `${infer N extends numb
45
41
  * StartsWith<'abcde', string>;
46
42
  * //=> never
47
43
  * ```
48
- *
49
- * @category String
50
- * @category Template literal
51
44
  */
52
45
  export type StartsWith<S extends string, SearchString extends string> = string extends S | SearchString ? never : S extends `${SearchString}${string | number | bigint | boolean | null | undefined}` ? true : false;
53
46
  /**
@@ -61,9 +54,6 @@ export type StartsWith<S extends string, SearchString extends string> = string e
61
54
  * StringLength<string>;
62
55
  * //=> never
63
56
  * ```
64
- *
65
- * @category String
66
- * @category Template literal
67
57
  */
68
58
  export type StringLength<S extends string> = string extends S ? never : StringToArray<S>["length"];
69
59
  /**
@@ -77,8 +67,6 @@ export type StringLength<S extends string> = string extends S ? never : StringTo
77
67
  * StringToArray<string>;
78
68
  * //=> never
79
69
  * ```
80
- *
81
- * @category String
82
70
  */
83
71
  export type StringToArray<S extends string, Result extends string[] = []> = string extends S ? never : S extends `${infer F}${infer R}` ? StringToArray<R, [...Result, F]> : Result;
84
72
  export type UpperCaseCharacters = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z";
@@ -749,8 +749,6 @@ export interface References {
749
749
  }
750
750
  /**
751
751
  * Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7).
752
- *
753
- * @category File
754
752
  */
755
753
  export interface TsConfigJson {
756
754
  /**
@@ -44,7 +44,7 @@ export interface NameValuePair<TValue, TName = string> {
44
44
  * @param A2 - to cast to
45
45
  * @returns `A1 | A2`
46
46
  */
47
- export type Cast<A1 extends any, A2 extends any> = A1 extends A2 ? A1 : A2;
47
+ export type Cast<A1, A2> = A1 extends A2 ? A1 : A2;
48
48
  export type DeepReadonly<T> = T extends Primitive ? T : T extends Array<infer U> ? DeepReadonlyArray<U> : DeepReadonlyObject<T>;
49
49
  export type DeepReadonlyArray<T> = ReadonlyArray<DeepReadonly<T>>;
50
50
  export type DeepReadonlyObject<T> = {
@@ -0,0 +1 @@
1
+ "use strict";
File without changes