@layerzerolabs/typescript-utils 1.2.12 → 1.2.14
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.
- package/dist/{ZVSZ2LTA.js → 3GUONMA5.js} +3 -3
- package/dist/{ZVSZ2LTA.js.map → 3GUONMA5.js.map} +1 -1
- package/dist/3STZQAJN.js +6 -0
- package/dist/{NXYWT3FC.js.map → 3STZQAJN.js.map} +1 -1
- package/dist/7K72QQNK.js +6 -0
- package/dist/{HA75XVBD.js.map → 7K72QQNK.js.map} +1 -1
- package/dist/{LBOSJOZV.js → 7Y67XUZE.js} +3 -3
- package/dist/{LBOSJOZV.js.map → 7Y67XUZE.js.map} +1 -1
- package/dist/BSNK5L7B.js +6 -0
- package/dist/{6QUS2SE6.js.map → BSNK5L7B.js.map} +1 -1
- package/dist/CYM4JWQD.js +6 -0
- package/dist/{TLUYOTQ3.js.map → CYM4JWQD.js.map} +1 -1
- package/dist/EHNXTLTB.js +6 -0
- package/dist/{RI75XMZ2.js.map → EHNXTLTB.js.map} +1 -1
- package/dist/K3OTXOMP.js +6 -0
- package/dist/{XL6YBUOB.js.map → K3OTXOMP.js.map} +1 -1
- package/dist/KDSQYXCE.js +6 -0
- package/dist/{S6NNED46.js.map → KDSQYXCE.js.map} +1 -1
- package/dist/MRRG35V3.js +6 -0
- package/dist/{NAAXLSE5.js.map → MRRG35V3.js.map} +1 -1
- package/dist/{ED5YIHCO.js → NT6KQXHL.js} +5 -5
- package/dist/{ED5YIHCO.js.map → NT6KQXHL.js.map} +1 -1
- package/dist/O6LUWQ7J.js +6 -0
- package/dist/{PNLZD2U2.js.map → O6LUWQ7J.js.map} +1 -1
- package/dist/{WUFNODVY.js → OBTB4CGS.js} +3 -3
- package/dist/{WUFNODVY.js.map → OBTB4CGS.js.map} +1 -1
- package/dist/P24OJW5S.js +6 -0
- package/dist/{FPYLH7RK.js.map → P24OJW5S.js.map} +1 -1
- package/dist/S3ZGPGBK.js +6 -0
- package/dist/{WQZJ7V44.js.map → S3ZGPGBK.js.map} +1 -1
- package/dist/SHJX4QBF.js +6 -0
- package/dist/{3LHZ7V3Z.js.map → SHJX4QBF.js.map} +1 -1
- package/dist/TM6TNTA7.js +6 -0
- package/dist/{QUJUTVP6.js.map → TM6TNTA7.js.map} +1 -1
- package/dist/VX6CBFIJ.js +6 -0
- package/dist/{I3HQPZG3.js.map → VX6CBFIJ.js.map} +1 -1
- package/dist/W24EH7Y4.js +6 -0
- package/dist/{VKIXMBVF.js.map → W24EH7Y4.js.map} +1 -1
- package/dist/WWLYEH6F.js +6 -0
- package/dist/{S7O2EBBN.js.map → WWLYEH6F.js.map} +1 -1
- package/dist/{SCG5YUF6.js → YG2Y6NOL.js} +3 -3
- package/dist/{SCG5YUF6.js.map → YG2Y6NOL.js.map} +1 -1
- package/dist/YUACM4JG.js +6 -0
- package/dist/{MUP2ZWKH.js.map → YUACM4JG.js.map} +1 -1
- package/dist/advancedRecord.js +2 -2
- package/dist/asyncify.js +2 -2
- package/dist/branded.js +2 -2
- package/dist/constructor.js +2 -2
- package/dist/deep.js +2 -2
- package/dist/deep.test-d.js +2 -2
- package/dist/disallowedAny.js +2 -2
- package/dist/functionalUtils.js +2 -2
- package/dist/identity.js +2 -2
- package/dist/index.js +20 -20
- package/dist/lastOf.js +2 -2
- package/dist/maybeUndefined.js +2 -2
- package/dist/merge.js +2 -2
- package/dist/methodOf.js +2 -2
- package/dist/promise.js +2 -2
- package/dist/removeNever.js +2 -2
- package/dist/strings.js +2 -2
- package/dist/strings.test-d.js +2 -2
- package/dist/tuples.js +2 -2
- package/dist/valueOf.js +2 -2
- package/dist/viem.js +2 -2
- package/dist/withRequired.js +2 -2
- package/package.json +5 -5
- package/dist/3LHZ7V3Z.js +0 -6
- package/dist/6QUS2SE6.js +0 -6
- package/dist/FPYLH7RK.js +0 -6
- package/dist/HA75XVBD.js +0 -6
- package/dist/I3HQPZG3.js +0 -6
- package/dist/MUP2ZWKH.js +0 -6
- package/dist/NAAXLSE5.js +0 -6
- package/dist/NXYWT3FC.js +0 -6
- package/dist/PNLZD2U2.js +0 -6
- package/dist/QUJUTVP6.js +0 -6
- package/dist/RI75XMZ2.js +0 -6
- package/dist/S6NNED46.js +0 -6
- package/dist/S7O2EBBN.js +0 -6
- package/dist/TLUYOTQ3.js +0 -6
- package/dist/VKIXMBVF.js +0 -6
- package/dist/WQZJ7V44.js +0 -6
- package/dist/XL6YBUOB.js +0 -6
package/dist/O6LUWQ7J.js
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/constructor.ts"],"names":[],"mappings":";;;AAAA,cAAA,EAAA","file":"
|
|
1
|
+
{"version":3,"sources":["../src/constructor.ts"],"names":[],"mappings":";;;AAAA,cAAA,EAAA","file":"O6LUWQ7J.js","sourcesContent":["export type Constructor<T> = { new (...args: any[]): T };\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { init_esm_shims, __name } from './
|
|
1
|
+
import { init_esm_shims, __name } from './3GUONMA5.js';
|
|
2
2
|
|
|
3
3
|
// src/promise.ts
|
|
4
4
|
init_esm_shims();
|
|
5
5
|
var isPromise = /* @__PURE__ */ __name((v) => v !== null && typeof v === "object" && typeof v.then === "function" && typeof v.catch === "function", "isPromise");
|
|
6
6
|
|
|
7
7
|
export { isPromise };
|
|
8
|
-
//# sourceMappingURL=
|
|
9
|
-
//# sourceMappingURL=
|
|
8
|
+
//# sourceMappingURL=OBTB4CGS.js.map
|
|
9
|
+
//# sourceMappingURL=OBTB4CGS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/promise.ts"],"names":["isPromise","v","then","catch"],"mappings":";;;AAAA,cAAA,EAAA;AAAO,IAAMA,SAAAA,mBAAY,MAAA,CAAA,CAACC,CAAAA,KACtBA,CAAAA,KAAM,QACN,OAAOA,CAAAA,KAAM,QAAA,IACb,OAAQA,EAA8BC,IAAAA,KAAS,UAAA,IAC/C,OAAQD,CAAAA,CAA8BE,UAAU,UAAA,EAJ3B,WAAA","file":"
|
|
1
|
+
{"version":3,"sources":["../src/promise.ts"],"names":["isPromise","v","then","catch"],"mappings":";;;AAAA,cAAA,EAAA;AAAO,IAAMA,SAAAA,mBAAY,MAAA,CAAA,CAACC,CAAAA,KACtBA,CAAAA,KAAM,QACN,OAAOA,CAAAA,KAAM,QAAA,IACb,OAAQA,EAA8BC,IAAAA,KAAS,UAAA,IAC/C,OAAQD,CAAAA,CAA8BE,UAAU,UAAA,EAJ3B,WAAA","file":"OBTB4CGS.js","sourcesContent":["export const isPromise = (v: unknown): v is Promise<unknown> =>\n v !== null &&\n typeof v === 'object' &&\n typeof (v as Record<string, unknown>).then === 'function' &&\n typeof (v as Record<string, unknown>).catch === 'function';\n"]}
|
package/dist/P24OJW5S.js
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lastOf.ts"],"names":[],"mappings":";;;AAcA,cAAA,EAAA","file":"
|
|
1
|
+
{"version":3,"sources":["../src/lastOf.ts"],"names":[],"mappings":";;;AAcA,cAAA,EAAA","file":"P24OJW5S.js","sourcesContent":["export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (\n k: infer I,\n) => void\n ? I\n : never;\n\nexport type LastOf<T> =\n UnionToIntersection<T extends any ? () => T : never> extends () => infer R ? R : never;\n\ntype Prepend<T, U extends any[]> = [T, ...U];\n\nexport type UnionToArray<T, U extends any[] = []> =\n LastOf<T> extends never ? U : UnionToArray<Exclude<T, LastOf<T>>, Prepend<LastOf<T>, U>>;\n\nexport type RestOf<T> = Exclude<T, LastOf<T>>;\n"]}
|
package/dist/S3ZGPGBK.js
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/identity.ts"],"names":[],"mappings":";;;AAAA,cAAA,EAAA","file":"
|
|
1
|
+
{"version":3,"sources":["../src/identity.ts"],"names":[],"mappings":";;;AAAA,cAAA,EAAA","file":"S3ZGPGBK.js","sourcesContent":["// Wraps types and property access with 1-arity which enables creating interfaces\nexport type Identity<T> = T;\n"]}
|
package/dist/SHJX4QBF.js
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/merge.ts"],"names":[],"mappings":";;;AAEA,cAAA,EAAA","file":"
|
|
1
|
+
{"version":3,"sources":["../src/merge.ts"],"names":[],"mappings":";;;AAEA,cAAA,EAAA","file":"SHJX4QBF.js","sourcesContent":["import type { Prettify } from './viem';\n\nexport type Merge<T, U> = {} extends T\n ? U\n : {} extends U\n ? T\n : Prettify<\n {\n [key in keyof T]: key extends keyof U ? U[key] : T[key];\n } & {\n [key in keyof U]: U[key];\n }\n >;\n"]}
|
package/dist/TM6TNTA7.js
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/valueOf.ts"],"names":[],"mappings":";;;AAMA,cAAA,EAAA","file":"
|
|
1
|
+
{"version":3,"sources":["../src/valueOf.ts"],"names":[],"mappings":";;;AAMA,cAAA,EAAA","file":"TM6TNTA7.js","sourcesContent":["export type IntersectionValueOf<T> = (\n T[keyof T] extends infer U ? (U extends any ? (x: U) => void : never) : never\n) extends (x: infer I) => void\n ? I\n : never;\n\n/**\n * @description Creates a type that extracts the values of T.\n *\n * @example\n * ValueOf<{ a: string, b: number }>\n * => string | number\n *\n * @internal\n */\nexport type ValueOf<T> = T[keyof T];\n"]}
|
package/dist/VX6CBFIJ.js
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/methodOf.ts"],"names":[],"mappings":";;;AAIA,cAAA,EAAA","file":"
|
|
1
|
+
{"version":3,"sources":["../src/methodOf.ts"],"names":[],"mappings":";;;AAIA,cAAA,EAAA","file":"VX6CBFIJ.js","sourcesContent":["export type MethodOf<T> = {\n [key in keyof T]: T[key] extends (...args: any[]) => any ? T[key] : never;\n}[keyof T];\n\nexport type MethodNameOf<T> = {\n [key in keyof T]: T[key] extends (...args: any[]) => any ? key : never;\n}[keyof T];\n"]}
|
package/dist/W24EH7Y4.js
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/advancedRecord.ts"],"names":[],"mappings":";;;AAMA,cAAA,EAAA","file":"
|
|
1
|
+
{"version":3,"sources":["../src/advancedRecord.ts"],"names":[],"mappings":";;;AAMA,cAAA,EAAA","file":"W24EH7Y4.js","sourcesContent":["export type AdvancedRecord<T = any, U = any> = {\n readonly [key: string]: readonly [T, U];\n};\n\nexport type DeepWritable<T> = { -readonly [P in keyof T]: DeepWritable<T[P]> };\n\nexport type AdvancedRecordLookup<\n AR extends AdvancedRecord | undefined,\n KeyToFind,\n> = AR extends AdvancedRecord\n ? {\n [P in keyof AR]: AR[P] extends readonly [infer K, infer V]\n ? // Distribute on K\n K extends unknown\n ? KeyToFind extends DeepWritable<K>\n ? V\n : DeepWritable<K> extends KeyToFind\n ? V\n : never\n : never\n : never;\n }[keyof AR]\n : never;\n"]}
|
package/dist/WWLYEH6F.js
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/viem.ts"],"names":[],"mappings":";;;AAAA,cAAA,EAAA","file":"
|
|
1
|
+
{"version":3,"sources":["../src/viem.ts"],"names":[],"mappings":";;;AAAA,cAAA,EAAA","file":"WWLYEH6F.js","sourcesContent":["/**\n * Filters out all members of {@link T} that are not {@link P}\n *\n * @param T - Items to filter\n * @param P - Type to filter out\n * @returns Filtered items\n *\n * @example\n * type Result = Filter<['a', 'b', 'c'], 'b'>\n * // ^? type Result = ['a', 'c']\n */\nexport type Filter<\n T extends readonly unknown[],\n P,\n Acc extends readonly unknown[] = [],\n> = T extends readonly [infer F, ...infer Rest extends readonly unknown[]]\n ? [F] extends [P]\n ? Filter<Rest, P, [...Acc, F]>\n : Filter<Rest, P, Acc>\n : readonly [...Acc];\n\n/**\n * @description Checks if {@link T} can be narrowed further than {@link U}\n * @param T - Type to check\n * @param U - Type to compare against\n * @example\n * type Result = IsNarrowable<'foo', string>\n * // ^? true\n */\nexport type IsNarrowable<T, U> =\n IsNever<(T extends U ? true : false) & (U extends T ? false : true)> extends true\n ? false\n : true;\n\n/**\n * @description Checks if {@link T} is `never`\n * @param T - Type to check\n * @example\n * type Result = IsNever<never>\n * // ^? type Result = true\n */\nexport type IsNever<T> = [T] extends [never] ? true : false;\n\n/** Removes `readonly` from all properties of an object. */\nexport type Mutable<type extends object> = {\n -readonly [key in keyof type]: type[key];\n};\n\n/**\n * @description Evaluates boolean \"or\" condition for {@link T} properties.\n * @param T - Type to check\n *\n * * @example\n * type Result = Or<[false, true, false]>\n * // ^? type Result = true\n *\n * @example\n * type Result = Or<[false, false, false]>\n * // ^? type Result = false\n */\nexport type Or<T extends readonly unknown[]> = T extends readonly [infer Head, ...infer Tail]\n ? Head extends true\n ? true\n : Or<Tail>\n : false;\n\n/**\n * @description Checks if {@link T} is `undefined`\n * @param T - Type to check\n * @example\n * type Result = IsUndefined<undefined>\n * // ^? type Result = true\n */\nexport type IsUndefined<T> = [undefined] extends [T] ? true : false;\n\nexport type MaybePromise<T> = T | Promise<T>;\n\n/**\n * @description Makes attributes on the type T required if required is true.\n *\n * @example\n * MaybeRequired<{ a: string, b?: number }, true>\n * => { a: string, b: number }\n *\n * MaybeRequired<{ a: string, b?: number }, false>\n * => { a: string, b?: number }\n */\nexport type MaybeRequired<T, required extends boolean> = required extends true\n ? ExactRequired<T>\n : T;\n\n/**\n * @description Assigns the properties of U onto T.\n *\n * @example\n * Assign<{ a: string, b: number }, { a: undefined, c: boolean }>\n * => { a: undefined, b: number, c: boolean }\n */\nexport type Assign<T, U> = Assign_<T, U> & U;\ntype Assign_<T, U> = {\n [K in keyof T as K extends keyof U ? (U[K] extends void ? never : K) : K]: K extends keyof U\n ? U[K]\n : T[K];\n};\n\n// TODO: Remove when peer dep `typescript@>=4.5` (NoInfer is native)\nexport type NoInfer<type> = [type][type extends any ? 0 : never];\n\n/**\n * @description Constructs a type by excluding `undefined` from `T`.\n *\n * @example\n * NoUndefined<string | undefined>\n * => string\n *\n * @internal\n */\nexport type NoUndefined<T> = T extends undefined ? never : T;\n\n/** Strict version of built-in Omit type */\nexport type Omit<type, keys extends keyof type> = Pick<type, Exclude<keyof type, keys>>;\n\n/**\n * @description Creates a type that is a partial of T, but with the required keys K.\n *\n * @example\n * PartialBy<{ a: string, b: number }, 'a'>\n * => { a?: string, b: number }\n */\nexport type PartialBy<T, K extends keyof T> = Omit<T, K> & ExactPartial<Pick<T, K>>;\n\n/**\n * @description Combines members of an intersection into a readable type.\n *\n * @see {@link https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg}\n * @example\n * Prettify<{ a: string } & { b: string } & { c: number, d: bigint }>\n * => { a: string, b: string, c: number, d: bigint }\n */\nexport type Prettify<T> = {\n [K in keyof T]: T[K];\n} & {};\n\n/** @internal */\nexport type Evaluate<type> = {\n [key in keyof type]: type[key];\n} & {};\n\n/**\n * @description Creates a type that is T with the required keys K.\n *\n * @example\n * RequiredBy<{ a?: string, b: number }, 'a'>\n * => { a: string, b: number }\n */\nexport type RequiredBy<T, K extends keyof T> = Omit<T, K> & ExactRequired<Pick<T, K>>;\n\n/**\n * @description Returns truthy if `array` contains `value`.\n *\n * @example\n * Some<[1, 2, 3], 2>\n * => true\n */\nexport type Some<array extends readonly unknown[], value> = array extends readonly [\n value,\n ...unknown[],\n]\n ? true\n : array extends readonly [unknown, ...infer rest]\n ? Some<rest, value>\n : false;\n\nexport type UnionToTuple<\n union,\n ///\n last = LastInUnion<union>,\n> = [union] extends [never] ? [] : [...UnionToTuple<Exclude<union, last>>, last];\ntype LastInUnion<U> =\n UnionToIntersection<U extends unknown ? (x: U) => 0 : never> extends (x: infer l) => 0\n ? l\n : never;\ntype UnionToIntersection<union> = (union extends unknown ? (arg: union) => 0 : never) extends (\n arg: infer i,\n) => 0\n ? i\n : never;\n\nexport type IsUnion<\n union,\n ///\n union2 = union,\n> = union extends union2 ? ([union2] extends [union] ? false : true) : never;\n\nexport type MaybePartial<type, enabled extends boolean | undefined> = enabled extends true\n ? Prettify<ExactPartial<type>>\n : type;\n\nexport type ExactPartial<type> = {\n [key in keyof type]?: type[key] | undefined;\n};\n\nexport type ExactRequired<type> = {\n [P in keyof type]-?: Exclude<type[P], undefined>;\n};\n\nexport type OneOf<\n union extends object,\n fallback extends object | undefined = undefined,\n ///\n keys extends KeyofUnion<union> = KeyofUnion<union>,\n> = union extends infer item\n ? Prettify<\n item & {\n [key in Exclude<keys, keyof item>]?: fallback extends object\n ? key extends keyof fallback\n ? fallback[key]\n : undefined\n : undefined;\n }\n >\n : never;\ntype KeyofUnion<type> = type extends type ? keyof type : never;\n\n///////////////////////////////////////////////////////////////////////////\n// Loose types\n\n/**\n * Loose version of {@link Omit}\n * @internal\n */\nexport type LooseOmit<type, keys extends string> = Pick<type, Exclude<keyof type, keys>>;\n\n///////////////////////////////////////////////////////////////////////////\n// Union types\n\nexport type UnionEvaluate<type> = type extends object ? Prettify<type> : type;\n\nexport type UnionLooseOmit<type, keys extends string> = type extends any\n ? LooseOmit<type, keys>\n : never;\n\n/**\n * @description Construct a type with the properties of union type T except for those in type K.\n * @example\n * type Result = UnionOmit<{ a: string, b: number } | { a: string, b: undefined, c: number }, 'a'>\n * => { b: number } | { b: undefined, c: number }\n */\nexport type UnionOmit<type, keys extends keyof type> = type extends any ? Omit<type, keys> : never;\n\n/**\n * @description Construct a type with the properties of union type T except for those in type K.\n * @example\n * type Result = UnionOmit<{ a: string, b: number } | { a: string, b: undefined, c: number }, 'a'>\n * => { b: number } | { b: undefined, c: number }\n */\nexport type UnionPick<type, keys extends keyof type> = type extends any ? Pick<type, keys> : never;\n\n/**\n * @description Creates a type that is a partial of T, but with the required keys K.\n *\n * @example\n * PartialBy<{ a: string, b: number } | { a: string, b: undefined, c: number }, 'a'>\n * => { a?: string, b: number } | { a?: string, b: undefined, c: number }\n */\nexport type UnionPartialBy<T, K extends keyof T> = T extends any ? PartialBy<T, K> : never;\n\n/**\n * @description Creates a type that is T with the required keys K.\n *\n * @example\n * RequiredBy<{ a?: string, b: number } | { a?: string, c?: number }, 'a'>\n * => { a: string, b: number } | { a: string, c?: number }\n */\nexport type UnionRequiredBy<T, K extends keyof T> = T extends any ? RequiredBy<T, K> : never;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { init_esm_shims, __name } from './
|
|
1
|
+
import { init_esm_shims, __name } from './3GUONMA5.js';
|
|
2
2
|
|
|
3
3
|
// ../../node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs
|
|
4
4
|
init_esm_shims();
|
|
@@ -1337,5 +1337,5 @@ var Bundle = class _Bundle {
|
|
|
1337
1337
|
};
|
|
1338
1338
|
|
|
1339
1339
|
export { Bundle, SourceMap, MagicString as default };
|
|
1340
|
-
//# sourceMappingURL=
|
|
1341
|
-
//# sourceMappingURL=
|
|
1340
|
+
//# sourceMappingURL=YG2Y6NOL.js.map
|
|
1341
|
+
//# sourceMappingURL=YG2Y6NOL.js.map
|