inferred-types 1.2.0 → 1.2.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.
@@ -2909,7 +2909,7 @@ type TypedError<T extends string = string, S extends string | undefined = string
2909
2909
  subType: S;
2910
2910
  [key: string]: any;
2911
2911
  }>;
2912
- type Err$2<TType extends string = string, TMsg extends string = string, TCtx extends Record<string, any> = EmptyObject> = TType extends `${infer Type}/${infer Subtype}` ? Expand<{
2912
+ type _Err<TType extends string = string, TMsg extends string = string, TCtx extends Record<string, any> = EmptyObject> = TType extends `${infer Type}/${infer Subtype}` ? Expand<{
2913
2913
  name: PascalCase<TCtx["name"] extends string ? TCtx["name"] : RetainUntil<TType, "/"> extends string ? RetainUntil<TType, "/"> : never>;
2914
2914
  type: KebabCase<Type>;
2915
2915
  subType: Subtype extends string ? KebabCase<Subtype> : undefined;
@@ -2923,6 +2923,16 @@ type Err$2<TType extends string = string, TMsg extends string = string, TCtx ext
2923
2923
  cause?: unknown;
2924
2924
  stack?: string;
2925
2925
  } & TCtx> & Error;
2926
+ /**
2927
+ * **Err**`<TType, TMsg, TCtx>`
2928
+ *
2929
+ * Create a strongly typed error with type and subType information.
2930
+ *
2931
+ * - TType assigns the type to the errors `type` property until a `/` character is found
2932
+ * - the `subType` property is the string literal portion of `TType` after the `/` character
2933
+ * - any key/value pairs on `TCtx` will be available on the error too
2934
+ */
2935
+ type Err$2<TType extends string = string, TMsg extends string = string, TCtx extends Record<string, any> = EmptyObject> = string extends TType ? string extends TMsg ? IsEqual<TCtx, EmptyObject> extends true ? Error : _Err<TType, TMsg, TCtx> : _Err<TType, TMsg, TCtx> : _Err<TType, TMsg, TCtx>;
2926
2936
  /**
2927
2937
  * Adds "context" to an existing `Error`.
2928
2938
  */
@@ -7738,6 +7748,8 @@ type Process$2<T, N extends number> = N extends 0 ? [] : MapItemType<GrowExp<[0]
7738
7748
  *
7739
7749
  * - if `TOpt` is set to true then it will add an optional
7740
7750
  * continuation of the type to unlimited length
7751
+ *
7752
+ * **Related:** `NumericSequence`
7741
7753
  */
7742
7754
  type FixedLengthArray$1<TType, TLen extends NumberLike$1, TExtends extends boolean = false> = TExtends extends true ? Process$2<TType, AsNumber<TLen>> extends readonly unknown[] ? [...Process$2<TType, AsNumber<TLen>>, ...TType[]] : never : Process$2<TType, AsNumber<TLen>> extends readonly unknown[] ? Process$2<TType, AsNumber<TLen>> : never;
7743
7755
  //#endregion
@@ -10259,7 +10271,7 @@ declare function getUrlQueryParams<T extends string, S extends string | undefine
10259
10271
  * Returns the default port which the given URL string would use
10260
10272
  * based on the protocol detected in this string.
10261
10273
  */
10262
- declare function getUrlDefaultPort<T extends string>(url: T): 22 | 21 | 23 | 25 | 80 | 443 | 53 | 853 | 142 | 110;
10274
+ declare function getUrlDefaultPort<T extends string>(url: T): 142 | 22 | 21 | 23 | 25 | 80 | 443 | 53 | 853 | 110;
10263
10275
  /**
10264
10276
  * **getUrlPort**`(url, [resolve])`
10265
10277
  *
@@ -10721,7 +10733,7 @@ declare function asInputToken<const T extends InputToken$1>(token: T): string |
10721
10733
  * that `InputToken__Object` and `InputToken__Tuple` are converted
10722
10734
  * to string representations.
10723
10735
  */
10724
- declare function toStringToken<T extends InputToken$1>(token: T): "string | symbol | number | false | true | null | bigint | void | { } | [ ]" | undefined;
10736
+ declare function toStringToken<T extends InputToken$1>(token: T): "string | false | true | symbol | number | null | bigint | void | { } | [ ]" | undefined;
10725
10737
  //# sourceMappingURL=asStringInputToken.d.ts.map
10726
10738
  //#endregion
10727
10739
  //#region src/runtime-types/tokens/input-tokens/fromDefineObject.d.ts