inferred-types 0.55.16 → 0.55.17

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.
@@ -13076,33 +13076,6 @@ type JsonValues$1<T extends Tuple$1> = {
13076
13076
  [K in keyof T]: JsonValue$1<T[K]>;
13077
13077
  };
13078
13078
 
13079
- /**
13080
- * **Replace**`<TText,TFind,TReplace>`
13081
- *
13082
- * Type utility which takes a string `TText` and finds the first instance of
13083
- * `TFind` and replaces it with `TReplace`.
13084
- *
13085
- * ```ts
13086
- * const fooy = "fooy";
13087
- * // "Foo"
13088
- * type Foo = Replace<typeof fooy, "y", "">;
13089
- * ```
13090
- *
13091
- * **Related:** `ReplaceAll`
13092
- */
13093
- type Replace$1<TText extends string, TFind extends string, TReplace extends string> = TText extends "" ? If$1<IsEqual$1<TFind, "">, TReplace, ""> : TFind extends "" ? TText : TText extends `${infer F}${TFind}${infer E}` ? `${F}${TReplace}${E}` : TText;
13094
-
13095
- /**
13096
- * Trims off whitespace on left of string
13097
- * ```ts
13098
- * // "foobar "
13099
- * type T = TrimLeft<"\n\t foobar ">;
13100
- * // string
13101
- * type T = TrimLeft<string>;
13102
- * ```
13103
- */
13104
- type TrimLeft$1<S extends string> = string extends S ? string : S extends `${Whitespace$1}${infer Right}` ? TrimLeft$1<Right> : S;
13105
-
13106
13079
  /**
13107
13080
  * Provides the _left_ whitespace of a string
13108
13081
  * ```ts
@@ -13228,6 +13201,22 @@ type RemoveIndex$1<T extends Record<any, any>> = {
13228
13201
  [P in keyof T as string extends P ? never : number extends P ? never : symbol extends P ? never : P]: T[P];
13229
13202
  };
13230
13203
 
13204
+ /**
13205
+ * **Replace**`<TText,TFind,TReplace>`
13206
+ *
13207
+ * Type utility which takes a string `TText` and finds the first instance of
13208
+ * `TFind` and replaces it with `TReplace`.
13209
+ *
13210
+ * ```ts
13211
+ * const fooy = "fooy";
13212
+ * // "Foo"
13213
+ * type Foo = Replace<typeof fooy, "y", "">;
13214
+ * ```
13215
+ *
13216
+ * **Related:** `ReplaceAll`
13217
+ */
13218
+ type Replace$1<TText extends string, TFind extends string, TReplace extends string> = TText extends "" ? If$1<IsEqual$1<TFind, "">, TReplace, ""> : TFind extends "" ? TText : TText extends `${infer F}${TFind}${infer E}` ? `${F}${TReplace}${E}` : TText;
13219
+
13231
13220
  type Process$J$1<TText extends string, TFind extends string, TReplace extends string> = Replace$1<TText, TFind, TReplace> extends `${string}${TFind}${string}` ? Process$J$1<Replace$1<TText, TFind, TReplace>, TFind, TReplace> : Replace$1<TText, TFind, TReplace>;
13232
13221
  type Iterate$2$1<TText extends string, TFind extends readonly string[], TReplace extends string> = [] extends TFind ? TText : Iterate$2$1<Process$J$1<TText, First$1<TFind>, TReplace>, AfterFirst$1<TFind>, TReplace>;
13233
13222
  type Singular$1<TText extends string, TFind extends string, TReplace extends string> = IsStringLiteral$1<TText> extends true ? IsStringLiteral$1<TFind> extends true ? IsUnion$1<TFind> extends true ? UnionToTuple$1$1<TFind> extends readonly string[] ? Iterate$2$1<TText, UnionToTuple$1$1<TFind>, TReplace> : never : Process$J$1<TText, TFind, TReplace> : string : string;
@@ -13266,17 +13255,6 @@ type Process$I$1<TChars extends readonly string[], TRetain extends string> = Rem
13266
13255
  */
13267
13256
  type RetainChars$1<TContent extends string, TRetain extends string> = Or$1<[IsWideType$1<TContent>, IsWideType$1<TRetain>]> extends true ? string : Process$I$1<Chars$1<TContent>, TRetain> extends readonly string[] ? Join$1<Process$I$1<Chars$1<TContent>, TRetain>> : never;
13268
13257
 
13269
- /**
13270
- * Trims off whitespace on left of string
13271
- * ```ts
13272
- * // "\n foobar"
13273
- * type T = TrimRight<"\n foobar \t">;
13274
- * // string
13275
- * type T = TrimRight<string>;
13276
- * ```
13277
- */
13278
- type TrimRight$1<S extends string> = string extends S ? string : S extends `${infer Right}${Whitespace$1}` ? TrimRight$1<Right> : S;
13279
-
13280
13258
  /**
13281
13259
  * Provides the _left_ whitespace of a string
13282
13260
  * ```ts
@@ -13355,6 +13333,28 @@ type Process$G$1<S extends string> = string extends S ? string : S extends `${Wh
13355
13333
  */
13356
13334
  type Trim$1<S extends string> = Process$G$1<S> extends string ? Process$G$1<S> : never;
13357
13335
 
13336
+ /**
13337
+ * Trims off whitespace on left of string
13338
+ * ```ts
13339
+ * // "foobar "
13340
+ * type T = TrimLeft<"\n\t foobar ">;
13341
+ * // string
13342
+ * type T = TrimLeft<string>;
13343
+ * ```
13344
+ */
13345
+ type TrimLeft$1<S extends string> = string extends S ? string : S extends `${Whitespace$1}${infer Right}` ? TrimLeft$1<Right> : S;
13346
+
13347
+ /**
13348
+ * Trims off whitespace on left of string
13349
+ * ```ts
13350
+ * // "\n foobar"
13351
+ * type T = TrimRight<"\n foobar \t">;
13352
+ * // string
13353
+ * type T = TrimRight<string>;
13354
+ * ```
13355
+ */
13356
+ type TrimRight$1<S extends string> = string extends S ? string : S extends `${infer Right}${Whitespace$1}` ? TrimRight$1<Right> : S;
13357
+
13358
13358
  /**
13359
13359
  * **ElementOf**`<T>`
13360
13360
  *
@@ -33228,33 +33228,6 @@ type JsonValues<T extends Tuple> = {
33228
33228
  [K in keyof T]: JsonValue<T[K]>;
33229
33229
  };
33230
33230
 
33231
- /**
33232
- * **Replace**`<TText,TFind,TReplace>`
33233
- *
33234
- * Type utility which takes a string `TText` and finds the first instance of
33235
- * `TFind` and replaces it with `TReplace`.
33236
- *
33237
- * ```ts
33238
- * const fooy = "fooy";
33239
- * // "Foo"
33240
- * type Foo = Replace<typeof fooy, "y", "">;
33241
- * ```
33242
- *
33243
- * **Related:** `ReplaceAll`
33244
- */
33245
- type Replace<TText extends string, TFind extends string, TReplace extends string> = TText extends "" ? If<IsEqual<TFind, "">, TReplace, ""> : TFind extends "" ? TText : TText extends `${infer F}${TFind}${infer E}` ? `${F}${TReplace}${E}` : TText;
33246
-
33247
- /**
33248
- * Trims off whitespace on left of string
33249
- * ```ts
33250
- * // "foobar "
33251
- * type T = TrimLeft<"\n\t foobar ">;
33252
- * // string
33253
- * type T = TrimLeft<string>;
33254
- * ```
33255
- */
33256
- type TrimLeft<S extends string> = string extends S ? string : S extends `${Whitespace}${infer Right}` ? TrimLeft<Right> : S;
33257
-
33258
33231
  /**
33259
33232
  * Provides the _left_ whitespace of a string
33260
33233
  * ```ts
@@ -33481,6 +33454,22 @@ type RemoveIndex<T extends Record<any, any>> = {
33481
33454
  [P in keyof T as string extends P ? never : number extends P ? never : symbol extends P ? never : P]: T[P];
33482
33455
  };
33483
33456
 
33457
+ /**
33458
+ * **Replace**`<TText,TFind,TReplace>`
33459
+ *
33460
+ * Type utility which takes a string `TText` and finds the first instance of
33461
+ * `TFind` and replaces it with `TReplace`.
33462
+ *
33463
+ * ```ts
33464
+ * const fooy = "fooy";
33465
+ * // "Foo"
33466
+ * type Foo = Replace<typeof fooy, "y", "">;
33467
+ * ```
33468
+ *
33469
+ * **Related:** `ReplaceAll`
33470
+ */
33471
+ type Replace<TText extends string, TFind extends string, TReplace extends string> = TText extends "" ? If<IsEqual<TFind, "">, TReplace, ""> : TFind extends "" ? TText : TText extends `${infer F}${TFind}${infer E}` ? `${F}${TReplace}${E}` : TText;
33472
+
33484
33473
  type Process$J<TText extends string, TFind extends string, TReplace extends string> = Replace<TText, TFind, TReplace> extends `${string}${TFind}${string}` ? Process$J<Replace<TText, TFind, TReplace>, TFind, TReplace> : Replace<TText, TFind, TReplace>;
33485
33474
  type Iterate$2<TText extends string, TFind extends readonly string[], TReplace extends string> = [] extends TFind ? TText : Iterate$2<Process$J<TText, First<TFind>, TReplace>, AfterFirst<TFind>, TReplace>;
33486
33475
  type Singular<TText extends string, TFind extends string, TReplace extends string> = IsStringLiteral<TText> extends true ? IsStringLiteral<TFind> extends true ? IsUnion<TFind> extends true ? UnionToTuple$1<TFind> extends readonly string[] ? Iterate$2<TText, UnionToTuple$1<TFind>, TReplace> : never : Process$J<TText, TFind, TReplace> : string : string;
@@ -33535,17 +33524,6 @@ type ProcessTuple$2<TArray extends readonly unknown[] | unknown[], TResults exte
33535
33524
  */
33536
33525
  type ReturnValues<TContainer extends readonly unknown[] | Dictionary> = TContainer extends readonly unknown[] ? ProcessTuple$2<TContainer> : TContainer extends Dictionary ? ProcessTuple$2<Values<TContainer>> : never;
33537
33526
 
33538
- /**
33539
- * Trims off whitespace on left of string
33540
- * ```ts
33541
- * // "\n foobar"
33542
- * type T = TrimRight<"\n foobar \t">;
33543
- * // string
33544
- * type T = TrimRight<string>;
33545
- * ```
33546
- */
33547
- type TrimRight<S extends string> = string extends S ? string : S extends `${infer Right}${Whitespace}` ? TrimRight<Right> : S;
33548
-
33549
33527
  /**
33550
33528
  * Provides the _left_ whitespace of a string
33551
33529
  * ```ts
@@ -33717,6 +33695,28 @@ type Process$G<S extends string> = string extends S ? string : S extends `${Whit
33717
33695
  */
33718
33696
  type Trim<S extends string> = Process$G<S> extends string ? Process$G<S> : never;
33719
33697
 
33698
+ /**
33699
+ * Trims off whitespace on left of string
33700
+ * ```ts
33701
+ * // "foobar "
33702
+ * type T = TrimLeft<"\n\t foobar ">;
33703
+ * // string
33704
+ * type T = TrimLeft<string>;
33705
+ * ```
33706
+ */
33707
+ type TrimLeft<S extends string> = string extends S ? string : S extends `${Whitespace}${infer Right}` ? TrimLeft<Right> : S;
33708
+
33709
+ /**
33710
+ * Trims off whitespace on left of string
33711
+ * ```ts
33712
+ * // "\n foobar"
33713
+ * type T = TrimRight<"\n foobar \t">;
33714
+ * // string
33715
+ * type T = TrimRight<string>;
33716
+ * ```
33717
+ */
33718
+ type TrimRight<S extends string> = string extends S ? string : S extends `${infer Right}${Whitespace}` ? TrimRight<Right> : S;
33719
+
33720
33720
  /**
33721
33721
  * **ElementOf**`<T>`
33722
33722
  *