@layerzerolabs/typescript-utils 0.2.45 → 0.2.47

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.
@@ -11,168 +11,168 @@
11
11
  CLI Cleaning output folder
12
12
  CJS Build start
13
13
  ESM Build start
14
+ Entry module "dist/EUBM3LSR.cjs" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
14
15
  "default" is imported from external module "path" but never used in "dist/6AHA7PAZ.js".
15
16
  "fileURLToPath" is imported from external module "url" but never used in "dist/6AHA7PAZ.js".
16
- Entry module "dist/EUBM3LSR.cjs" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
17
- ESM dist/valueOf.js 119.00 B
18
- ESM dist/viem.js 113.00 B
19
- ESM dist/withRequired.js 129.00 B
20
- ESM dist/tuples.js 117.00 B
21
- ESM dist/EM7SXG4B.js 157.00 B
22
- ESM dist/ENRZFLLD.js 155.00 B
23
- ESM dist/index.js 558.00 B
24
- ESM dist/62TVLGZP.js 163.00 B
25
- ESM dist/TQNP6GIE.js 158.00 B
26
- ESM dist/GGKJNPTT.js 42.15 KB
27
- ESM dist/lastOf.js 117.00 B
28
- ESM dist/maybeUndefined.js 133.00 B
29
- ESM dist/KZQATXOW.js 157.00 B
30
- ESM dist/Q6UBIYTZ.js 165.00 B
31
- ESM dist/merge.js 115.00 B
32
- ESM dist/DDDCRYAA.js 156.00 B
33
- ESM dist/methodOf.js 121.00 B
34
- ESM dist/KEJFF7VD.js 159.00 B
35
- ESM dist/removeNever.js 127.00 B
36
- ESM dist/strings.test-d.js 745.00 B
37
- ESM dist/B5GSIBEU.js 158.00 B
38
- ESM dist/advancedRecord.js 133.00 B
39
- ESM dist/I5NXBMAF.js 162.00 B
40
- ESM dist/strings.js 119.00 B
41
- ESM dist/CFTTK4D6.js 165.00 B
42
- ESM dist/asyncify.js 121.00 B
43
- ESM dist/TP4DJK6G.js 159.00 B
44
- ESM dist/branded.js 119.00 B
45
- ESM dist/X6GYSLZB.js 162.00 B
46
- ESM dist/deep.test-d.js 491.00 B
47
- ESM dist/constructor.js 127.00 B
48
- ESM dist/deep.js 113.00 B
49
- ESM dist/FQ2L5NQU.js 155.00 B
50
- ESM dist/6IUBP3YE.js 158.00 B
51
- ESM dist/V353KAGF.js 164.00 B
52
- ESM dist/identity.js 121.00 B
53
- ESM dist/P3JODCMF.js 159.00 B
54
- ESM dist/disallowedAny.js 131.00 B
55
- ESM dist/6AHA7PAZ.js 1.87 KB
56
- ESM dist/CI7BVOAG.js 295.28 KB
57
- ESM dist/valueOf.js.map 71.00 B
58
- ESM dist/viem.js.map 68.00 B
59
- ESM dist/withRequired.js.map 76.00 B
60
- ESM dist/EM7SXG4B.js.map 2.66 KB
61
- ESM dist/tuples.js.map 70.00 B
62
- ESM dist/ENRZFLLD.js.map 8.23 KB
63
- ESM dist/index.js.map 644.00 B
64
- ESM dist/62TVLGZP.js.map 278.00 B
65
- ESM dist/TQNP6GIE.js.map 517.00 B
66
- ESM dist/maybeUndefined.js.map 78.00 B
67
- ESM dist/KZQATXOW.js.map 638.00 B
68
- ESM dist/GGKJNPTT.js.map 100.16 KB
69
- ESM dist/Q6UBIYTZ.js.map 621.00 B
70
- ESM dist/merge.js.map 69.00 B
71
- ESM dist/methodOf.js.map 72.00 B
72
- ESM dist/DDDCRYAA.js.map 448.00 B
73
- ESM dist/lastOf.js.map 70.00 B
74
- ESM dist/KEJFF7VD.js.map 378.00 B
75
- ESM dist/removeNever.js.map 75.00 B
76
- ESM dist/B5GSIBEU.js.map 1.40 KB
77
- ESM dist/strings.test-d.js.map 1.68 KB
78
- ESM dist/advancedRecord.js.map 78.00 B
79
- ESM dist/I5NXBMAF.js.map 231.00 B
80
- ESM dist/strings.js.map 71.00 B
81
- ESM dist/asyncify.js.map 72.00 B
82
- ESM dist/CFTTK4D6.js.map 885.00 B
83
- ESM dist/TP4DJK6G.js.map 320.00 B
84
- ESM dist/branded.js.map 71.00 B
85
- ESM dist/deep.test-d.js.map 1.45 KB
86
- ESM dist/constructor.js.map 75.00 B
87
- ESM dist/FQ2L5NQU.js.map 759.00 B
88
- ESM dist/deep.js.map 68.00 B
89
- ESM dist/6IUBP3YE.js.map 698.00 B
90
- ESM dist/identity.js.map 72.00 B
91
- ESM dist/V353KAGF.js.map 369.00 B
92
- ESM dist/P3JODCMF.js.map 244.00 B
93
- ESM dist/X6GYSLZB.js.map 193.00 B
94
- ESM dist/disallowedAny.js.map 77.00 B
95
- ESM dist/6AHA7PAZ.js.map 666.00 B
96
- ESM dist/CI7BVOAG.js.map 761.96 KB
97
- ESM ⚡️ Build success in 2058ms
98
17
  CJS dist/tuples.cjs 141.00 B
99
- CJS dist/viem.cjs 137.00 B
100
- CJS dist/withRequired.cjs 153.00 B
101
18
  CJS dist/valueOf.cjs 143.00 B
102
- CJS dist/index.cjs 639.00 B
103
- CJS dist/KQUDWU4T.cjs 187.00 B
19
+ CJS dist/viem.cjs 137.00 B
104
20
  CJS dist/2MZ52QXI.cjs 188.00 B
21
+ CJS dist/B4TXK443.cjs 185.00 B
22
+ CJS dist/withRequired.cjs 153.00 B
105
23
  CJS dist/4W25K7RR.cjs 193.00 B
106
- CJS dist/ZDGUYQPS.cjs 185.00 B
107
- CJS dist/2OSBYVBM.cjs 187.00 B
108
24
  CJS dist/lastOf.cjs 141.00 B
25
+ CJS dist/2OSBYVBM.cjs 187.00 B
109
26
  CJS dist/maybeUndefined.cjs 157.00 B
110
27
  CJS dist/7RPBI4LQ.cjs 195.00 B
28
+ CJS dist/merge.cjs 139.00 B
111
29
  CJS dist/AKBGASRF.cjs 186.00 B
30
+ CJS dist/EUBM3LSR.cjs 42.53 KB
31
+ CJS dist/NKWLAYNJ.cjs 189.00 B
112
32
  CJS dist/methodOf.cjs 145.00 B
33
+ CJS dist/Q35ZNXMT.cjs 192.00 B
113
34
  CJS dist/removeNever.cjs 151.00 B
114
- CJS dist/NKWLAYNJ.cjs 189.00 B
115
35
  CJS dist/strings.test-d.cjs 904.00 B
116
- CJS dist/Q35ZNXMT.cjs 192.00 B
36
+ CJS dist/strings.cjs 143.00 B
37
+ CJS dist/advancedRecord.cjs 157.00 B
117
38
  CJS dist/K3FZ3EZT.cjs 188.00 B
118
- CJS dist/merge.cjs 139.00 B
119
39
  CJS dist/C7GMKBCN.cjs 195.00 B
120
- CJS dist/advancedRecord.cjs 157.00 B
121
40
  CJS dist/asyncify.cjs 145.00 B
122
41
  CJS dist/WPET3HPL.cjs 189.00 B
123
42
  CJS dist/branded.cjs 143.00 B
124
43
  CJS dist/2SJJDCZI.cjs 188.00 B
125
- CJS dist/strings.cjs 143.00 B
126
44
  CJS dist/constructor.cjs 151.00 B
127
- CJS dist/deep.test-d.cjs 580.00 B
128
- CJS dist/53OHF4EH.cjs 192.00 B
129
45
  CJS dist/deep.cjs 137.00 B
130
- CJS dist/EUBM3LSR.cjs 42.53 KB
46
+ CJS dist/53OHF4EH.cjs 192.00 B
131
47
  CJS dist/MLSONTXK.cjs 185.00 B
48
+ CJS dist/index.cjs 639.00 B
132
49
  CJS dist/disallowedAny.cjs 155.00 B
133
- CJS dist/574X5FJM.cjs 194.00 B
134
- CJS dist/TVCGTTL5.cjs 189.00 B
135
50
  CJS dist/identity.cjs 145.00 B
51
+ CJS dist/TVCGTTL5.cjs 189.00 B
136
52
  CJS dist/24WEKBY3.cjs 2.10 KB
53
+ CJS dist/574X5FJM.cjs 194.00 B
54
+ CJS dist/KQUDWU4T.cjs 187.00 B
55
+ CJS dist/deep.test-d.cjs 580.00 B
137
56
  CJS dist/7BSTQVJO.cjs 301.19 KB
138
57
  CJS dist/tuples.cjs.map 71.00 B
139
58
  CJS dist/viem.cjs.map 69.00 B
140
- CJS dist/withRequired.cjs.map 77.00 B
141
- CJS dist/index.cjs.map 665.00 B
142
59
  CJS dist/valueOf.cjs.map 72.00 B
143
- CJS dist/2MZ52QXI.cjs.map 538.00 B
144
- CJS dist/4W25K7RR.cjs.map 299.00 B
145
- CJS dist/KQUDWU4T.cjs.map 2.68 KB
146
- CJS dist/ZDGUYQPS.cjs.map 8.25 KB
147
60
  CJS dist/2OSBYVBM.cjs.map 659.00 B
148
61
  CJS dist/lastOf.cjs.map 71.00 B
62
+ CJS dist/4W25K7RR.cjs.map 299.00 B
63
+ CJS dist/7RPBI4LQ.cjs.map 642.00 B
149
64
  CJS dist/maybeUndefined.cjs.map 79.00 B
65
+ CJS dist/merge.cjs.map 70.00 B
150
66
  CJS dist/AKBGASRF.cjs.map 469.00 B
151
- CJS dist/methodOf.cjs.map 73.00 B
152
67
  CJS dist/NKWLAYNJ.cjs.map 399.00 B
68
+ CJS dist/methodOf.cjs.map 73.00 B
69
+ CJS dist/Q35ZNXMT.cjs.map 252.00 B
153
70
  CJS dist/removeNever.cjs.map 76.00 B
154
- CJS dist/7RPBI4LQ.cjs.map 642.00 B
71
+ CJS dist/EUBM3LSR.cjs.map 100.19 KB
155
72
  CJS dist/strings.test-d.cjs.map 1.70 KB
156
- CJS dist/Q35ZNXMT.cjs.map 252.00 B
73
+ CJS dist/advancedRecord.cjs.map 79.00 B
74
+ CJS dist/strings.cjs.map 72.00 B
157
75
  CJS dist/K3FZ3EZT.cjs.map 1.42 KB
158
- CJS dist/merge.cjs.map 70.00 B
159
- CJS dist/C7GMKBCN.cjs.map 906.00 B
160
76
  CJS dist/asyncify.cjs.map 73.00 B
77
+ CJS dist/C7GMKBCN.cjs.map 906.00 B
78
+ CJS dist/branded.cjs.map 72.00 B
161
79
  CJS dist/WPET3HPL.cjs.map 341.00 B
162
80
  CJS dist/2SJJDCZI.cjs.map 719.00 B
163
- CJS dist/branded.cjs.map 72.00 B
164
81
  CJS dist/constructor.cjs.map 76.00 B
165
- CJS dist/strings.cjs.map 72.00 B
166
- CJS dist/deep.test-d.cjs.map 1.47 KB
167
82
  CJS dist/53OHF4EH.cjs.map 214.00 B
168
- CJS dist/advancedRecord.cjs.map 79.00 B
169
83
  CJS dist/deep.cjs.map 69.00 B
170
84
  CJS dist/MLSONTXK.cjs.map 780.00 B
171
85
  CJS dist/disallowedAny.cjs.map 78.00 B
172
- CJS dist/EUBM3LSR.cjs.map 100.19 KB
173
- CJS dist/574X5FJM.cjs.map 390.00 B
174
- CJS dist/TVCGTTL5.cjs.map 265.00 B
86
+ CJS dist/index.cjs.map 665.00 B
175
87
  CJS dist/identity.cjs.map 73.00 B
88
+ CJS dist/TVCGTTL5.cjs.map 265.00 B
176
89
  CJS dist/24WEKBY3.cjs.map 923.00 B
90
+ CJS dist/574X5FJM.cjs.map 390.00 B
91
+ CJS dist/KQUDWU4T.cjs.map 2.68 KB
92
+ CJS dist/deep.test-d.cjs.map 1.47 KB
93
+ CJS dist/2MZ52QXI.cjs.map 538.00 B
94
+ CJS dist/B4TXK443.cjs.map 8.26 KB
95
+ CJS dist/withRequired.cjs.map 77.00 B
177
96
  CJS dist/7BSTQVJO.cjs.map 762.74 KB
178
- CJS ⚡️ Build success in 2061ms
97
+ CJS ⚡️ Build success in 1200ms
98
+ ESM dist/tuples.js 117.00 B
99
+ ESM dist/withRequired.js 129.00 B
100
+ ESM dist/viem.js 113.00 B
101
+ ESM dist/valueOf.js 119.00 B
102
+ ESM dist/index.js 558.00 B
103
+ ESM dist/EM7SXG4B.js 157.00 B
104
+ ESM dist/TQNP6GIE.js 158.00 B
105
+ ESM dist/J7BAXUWJ.js 155.00 B
106
+ ESM dist/62TVLGZP.js 163.00 B
107
+ ESM dist/lastOf.js 117.00 B
108
+ ESM dist/maybeUndefined.js 133.00 B
109
+ ESM dist/KZQATXOW.js 157.00 B
110
+ ESM dist/Q6UBIYTZ.js 165.00 B
111
+ ESM dist/merge.js 115.00 B
112
+ ESM dist/methodOf.js 121.00 B
113
+ ESM dist/DDDCRYAA.js 156.00 B
114
+ ESM dist/removeNever.js 127.00 B
115
+ ESM dist/I5NXBMAF.js 162.00 B
116
+ ESM dist/strings.test-d.js 745.00 B
117
+ ESM dist/KEJFF7VD.js 159.00 B
118
+ ESM dist/B5GSIBEU.js 158.00 B
119
+ ESM dist/advancedRecord.js 133.00 B
120
+ ESM dist/strings.js 119.00 B
121
+ ESM dist/CFTTK4D6.js 165.00 B
122
+ ESM dist/asyncify.js 121.00 B
123
+ ESM dist/GGKJNPTT.js 42.15 KB
124
+ ESM dist/branded.js 119.00 B
125
+ ESM dist/TP4DJK6G.js 159.00 B
126
+ ESM dist/6IUBP3YE.js 158.00 B
127
+ ESM dist/deep.js 113.00 B
128
+ ESM dist/X6GYSLZB.js 162.00 B
129
+ ESM dist/constructor.js 127.00 B
130
+ ESM dist/deep.test-d.js 491.00 B
131
+ ESM dist/disallowedAny.js 131.00 B
132
+ ESM dist/FQ2L5NQU.js 155.00 B
133
+ ESM dist/V353KAGF.js 164.00 B
134
+ ESM dist/identity.js 121.00 B
135
+ ESM dist/P3JODCMF.js 159.00 B
136
+ ESM dist/6AHA7PAZ.js 1.87 KB
137
+ ESM dist/CI7BVOAG.js 295.28 KB
138
+ ESM dist/tuples.js.map 70.00 B
139
+ ESM dist/withRequired.js.map 76.00 B
140
+ ESM dist/viem.js.map 68.00 B
141
+ ESM dist/valueOf.js.map 71.00 B
142
+ ESM dist/62TVLGZP.js.map 278.00 B
143
+ ESM dist/index.js.map 644.00 B
144
+ ESM dist/lastOf.js.map 70.00 B
145
+ ESM dist/maybeUndefined.js.map 78.00 B
146
+ ESM dist/EM7SXG4B.js.map 2.66 KB
147
+ ESM dist/KZQATXOW.js.map 638.00 B
148
+ ESM dist/Q6UBIYTZ.js.map 621.00 B
149
+ ESM dist/merge.js.map 69.00 B
150
+ ESM dist/removeNever.js.map 75.00 B
151
+ ESM dist/DDDCRYAA.js.map 448.00 B
152
+ ESM dist/I5NXBMAF.js.map 231.00 B
153
+ ESM dist/strings.test-d.js.map 1.68 KB
154
+ ESM dist/methodOf.js.map 72.00 B
155
+ ESM dist/KEJFF7VD.js.map 378.00 B
156
+ ESM dist/advancedRecord.js.map 78.00 B
157
+ ESM dist/CFTTK4D6.js.map 885.00 B
158
+ ESM dist/strings.js.map 71.00 B
159
+ ESM dist/asyncify.js.map 72.00 B
160
+ ESM dist/branded.js.map 71.00 B
161
+ ESM dist/TP4DJK6G.js.map 320.00 B
162
+ ESM dist/B5GSIBEU.js.map 1.40 KB
163
+ ESM dist/6IUBP3YE.js.map 698.00 B
164
+ ESM dist/deep.js.map 68.00 B
165
+ ESM dist/X6GYSLZB.js.map 193.00 B
166
+ ESM dist/constructor.js.map 75.00 B
167
+ ESM dist/deep.test-d.js.map 1.45 KB
168
+ ESM dist/disallowedAny.js.map 77.00 B
169
+ ESM dist/FQ2L5NQU.js.map 759.00 B
170
+ ESM dist/V353KAGF.js.map 369.00 B
171
+ ESM dist/identity.js.map 72.00 B
172
+ ESM dist/GGKJNPTT.js.map 100.16 KB
173
+ ESM dist/P3JODCMF.js.map 244.00 B
174
+ ESM dist/6AHA7PAZ.js.map 666.00 B
175
+ ESM dist/TQNP6GIE.js.map 517.00 B
176
+ ESM dist/J7BAXUWJ.js.map 8.24 KB
177
+ ESM dist/CI7BVOAG.js.map 761.96 KB
178
+ ESM ⚡️ Build success in 1203ms
@@ -2,7 +2,7 @@
2
2
  > @layerzerolabs/typescript-utils@0.0.0 lint /home/runner/work/monorepo-internal/monorepo-internal/packages/typescript-utils
3
3
  > eslint . --max-warnings 0 || (eslint . --fix --max-warnings 0 && false)
4
4
 
5
- (node:64256) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///home/runner/work/monorepo-internal/monorepo-internal/eslint.config.js?mtime=1772645192265 is not specified and it doesn't parse as CommonJS.
5
+ (node:43805) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///home/runner/work/monorepo-internal/monorepo-internal/eslint.config.js?mtime=1772832456735 is not specified and it doesn't parse as CommonJS.
6
6
  Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
7
7
  To eliminate this warning, add "type": "module" to /home/runner/work/monorepo-internal/monorepo-internal/package.json.
8
8
  (Use `node --trace-warnings ...` to show where the warning was created)
@@ -4,5 +4,5 @@ var _24WEKBY3_cjs = require('./24WEKBY3.cjs');
4
4
 
5
5
  // src/viem.ts
6
6
  _24WEKBY3_cjs.init_cjs_shims();
7
- //# sourceMappingURL=ZDGUYQPS.cjs.map
8
- //# sourceMappingURL=ZDGUYQPS.cjs.map
7
+ //# sourceMappingURL=B4TXK443.cjs.map
8
+ //# sourceMappingURL=B4TXK443.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/viem.ts"],"names":["init_cjs_shims"],"mappings":";;;;;AAAAA,4BAAA,EAAA","file":"B4TXK443.cjs","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"]}
@@ -2,5 +2,5 @@ import { init_esm_shims } from './6AHA7PAZ.js';
2
2
 
3
3
  // src/viem.ts
4
4
  init_esm_shims();
5
- //# sourceMappingURL=ENRZFLLD.js.map
6
- //# sourceMappingURL=ENRZFLLD.js.map
5
+ //# sourceMappingURL=J7BAXUWJ.js.map
6
+ //# sourceMappingURL=J7BAXUWJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/viem.ts"],"names":[],"mappings":";;;AAAA,cAAA,EAAA","file":"J7BAXUWJ.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"]}
package/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./KQUDWU4T.cjs');
4
4
  require('./2MZ52QXI.cjs');
5
- require('./ZDGUYQPS.cjs');
5
+ require('./B4TXK443.cjs');
6
6
  require('./4W25K7RR.cjs');
7
7
  require('./2OSBYVBM.cjs');
8
8
  require('./7RPBI4LQ.cjs');
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import './EM7SXG4B.js';
2
2
  import './TQNP6GIE.js';
3
- import './ENRZFLLD.js';
3
+ import './J7BAXUWJ.js';
4
4
  import './62TVLGZP.js';
5
5
  import './KZQATXOW.js';
6
6
  import './Q6UBIYTZ.js';
package/dist/viem.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- require('./ZDGUYQPS.cjs');
3
+ require('./B4TXK443.cjs');
4
4
  require('./24WEKBY3.cjs');
5
5
 
6
6
  //# sourceMappingURL=viem.cjs.map
package/dist/viem.d.ts CHANGED
@@ -13,7 +13,7 @@ export type Filter<T extends readonly unknown[], P, Acc extends readonly unknown
13
13
  /**
14
14
  * @description Checks if {@link T} can be narrowed further than {@link U}
15
15
  * @param T - Type to check
16
- * @param U - Type to against
16
+ * @param U - Type to compare against
17
17
  * @example
18
18
  * type Result = IsNarrowable<'foo', string>
19
19
  * // ^? true
package/dist/viem.js CHANGED
@@ -1,4 +1,4 @@
1
- import './ENRZFLLD.js';
1
+ import './J7BAXUWJ.js';
2
2
  import './6AHA7PAZ.js';
3
3
  //# sourceMappingURL=viem.js.map
4
4
  //# sourceMappingURL=viem.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerzerolabs/typescript-utils",
3
- "version": "0.2.45",
3
+ "version": "0.2.47",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -16,8 +16,8 @@
16
16
  "devDependencies": {
17
17
  "tsup": "^8.4.0",
18
18
  "vitest": "^3.2.3",
19
- "@layerzerolabs/tsup-configuration": "0.2.45",
20
- "@layerzerolabs/typescript-configuration": "0.2.45"
19
+ "@layerzerolabs/tsup-configuration": "0.2.47",
20
+ "@layerzerolabs/typescript-configuration": "0.2.47"
21
21
  },
22
22
  "publishConfig": {
23
23
  "access": "public",
package/src/viem.ts CHANGED
@@ -22,7 +22,7 @@ export type Filter<
22
22
  /**
23
23
  * @description Checks if {@link T} can be narrowed further than {@link U}
24
24
  * @param T - Type to check
25
- * @param U - Type to against
25
+ * @param U - Type to compare against
26
26
  * @example
27
27
  * type Result = IsNarrowable<'foo', string>
28
28
  * // ^? true
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/viem.ts"],"names":[],"mappings":";;;AAAA,cAAA,EAAA","file":"ENRZFLLD.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 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 +0,0 @@
1
- {"version":3,"sources":["../src/viem.ts"],"names":["init_cjs_shims"],"mappings":";;;;;AAAAA,4BAAA,EAAA","file":"ZDGUYQPS.cjs","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 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"]}