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.
@@ -8981,33 +8981,6 @@ type JsonValues<T extends Tuple> = {
8981
8981
  [K in keyof T]: JsonValue<T[K]>;
8982
8982
  };
8983
8983
 
8984
- /**
8985
- * **Replace**`<TText,TFind,TReplace>`
8986
- *
8987
- * Type utility which takes a string `TText` and finds the first instance of
8988
- * `TFind` and replaces it with `TReplace`.
8989
- *
8990
- * ```ts
8991
- * const fooy = "fooy";
8992
- * // "Foo"
8993
- * type Foo = Replace<typeof fooy, "y", "">;
8994
- * ```
8995
- *
8996
- * **Related:** `ReplaceAll`
8997
- */
8998
- 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;
8999
-
9000
- /**
9001
- * Trims off whitespace on left of string
9002
- * ```ts
9003
- * // "foobar "
9004
- * type T = TrimLeft<"\n\t foobar ">;
9005
- * // string
9006
- * type T = TrimLeft<string>;
9007
- * ```
9008
- */
9009
- type TrimLeft<S extends string> = string extends S ? string : S extends `${Whitespace}${infer Right}` ? TrimLeft<Right> : S;
9010
-
9011
8984
  /**
9012
8985
  * Provides the _left_ whitespace of a string
9013
8986
  * ```ts
@@ -9133,6 +9106,22 @@ type RemoveIndex<T extends Record<any, any>> = {
9133
9106
  [P in keyof T as string extends P ? never : number extends P ? never : symbol extends P ? never : P]: T[P];
9134
9107
  };
9135
9108
 
9109
+ /**
9110
+ * **Replace**`<TText,TFind,TReplace>`
9111
+ *
9112
+ * Type utility which takes a string `TText` and finds the first instance of
9113
+ * `TFind` and replaces it with `TReplace`.
9114
+ *
9115
+ * ```ts
9116
+ * const fooy = "fooy";
9117
+ * // "Foo"
9118
+ * type Foo = Replace<typeof fooy, "y", "">;
9119
+ * ```
9120
+ *
9121
+ * **Related:** `ReplaceAll`
9122
+ */
9123
+ 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;
9124
+
9136
9125
  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>;
9137
9126
  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>;
9138
9127
  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;
@@ -9171,17 +9160,6 @@ type Process$I<TChars extends readonly string[], TRetain extends string> = Remov
9171
9160
  */
9172
9161
  type RetainChars<TContent extends string, TRetain extends string> = Or<[IsWideType<TContent>, IsWideType<TRetain>]> extends true ? string : Process$I<Chars<TContent>, TRetain> extends readonly string[] ? Join<Process$I<Chars<TContent>, TRetain>> : never;
9173
9162
 
9174
- /**
9175
- * Trims off whitespace on left of string
9176
- * ```ts
9177
- * // "\n foobar"
9178
- * type T = TrimRight<"\n foobar \t">;
9179
- * // string
9180
- * type T = TrimRight<string>;
9181
- * ```
9182
- */
9183
- type TrimRight<S extends string> = string extends S ? string : S extends `${infer Right}${Whitespace}` ? TrimRight<Right> : S;
9184
-
9185
9163
  /**
9186
9164
  * Provides the _left_ whitespace of a string
9187
9165
  * ```ts
@@ -9260,6 +9238,28 @@ type Process$G<S extends string> = string extends S ? string : S extends `${Whit
9260
9238
  */
9261
9239
  type Trim<S extends string> = Process$G<S> extends string ? Process$G<S> : never;
9262
9240
 
9241
+ /**
9242
+ * Trims off whitespace on left of string
9243
+ * ```ts
9244
+ * // "foobar "
9245
+ * type T = TrimLeft<"\n\t foobar ">;
9246
+ * // string
9247
+ * type T = TrimLeft<string>;
9248
+ * ```
9249
+ */
9250
+ type TrimLeft<S extends string> = string extends S ? string : S extends `${Whitespace}${infer Right}` ? TrimLeft<Right> : S;
9251
+
9252
+ /**
9253
+ * Trims off whitespace on left of string
9254
+ * ```ts
9255
+ * // "\n foobar"
9256
+ * type T = TrimRight<"\n foobar \t">;
9257
+ * // string
9258
+ * type T = TrimRight<string>;
9259
+ * ```
9260
+ */
9261
+ type TrimRight<S extends string> = string extends S ? string : S extends `${infer Right}${Whitespace}` ? TrimRight<Right> : S;
9262
+
9263
9263
  /**
9264
9264
  * **ElementOf**`<T>`
9265
9265
  *