@layerzerolabs/typescript-utils 0.0.45 → 0.0.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.
@@ -2,5 +2,5 @@ import { init_esm_shims } from './4RNWLMHM.js';
2
2
 
3
3
  // src/deep.ts
4
4
  init_esm_shims();
5
- //# sourceMappingURL=H4XPUNCM.js.map
6
- //# sourceMappingURL=H4XPUNCM.js.map
5
+ //# sourceMappingURL=X43TXNZ3.js.map
6
+ //# sourceMappingURL=X43TXNZ3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/deep.ts"],"names":[],"mappings":";;;AAEA,cAAA,EAAA","file":"X43TXNZ3.js","sourcesContent":["import type { Prettify } from './viem';\n\n/**\n * Copy the brand tag from the branded.ts file, can't import it to keep it hidden from library users\n */\nconst brandTag = '___tag___';\n\nexport type DeepRequire<T> = {\n [P in keyof T]-?: DeepRequire<T[P]>;\n};\n\nexport type DeepOptional<T> = T extends { [brandTag]: infer U }\n ? Prettify<\n { [brandTag]: U } & {\n [P in keyof T]?: DeepOptional<T[P]>;\n }\n >\n : {\n [P in keyof T]?: DeepOptional<T[P]>;\n };\n"]}
package/dist/deep.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- require('./PUPSLF67.cjs');
3
+ require('./LJLAUEED.cjs');
4
4
  require('./U7VZULNU.cjs');
5
5
 
6
6
  //# sourceMappingURL=deep.cjs.map
package/dist/deep.d.ts CHANGED
@@ -1,7 +1,19 @@
1
+ import type { Prettify } from './viem';
2
+ /**
3
+ * Copy the brand tag from the branded.ts file, can't import it to keep it hidden from library users
4
+ */
5
+ declare const brandTag = "___tag___";
1
6
  export type DeepRequire<T> = {
2
7
  [P in keyof T]-?: DeepRequire<T[P]>;
3
8
  };
4
- export type DeepOptional<T> = {
9
+ export type DeepOptional<T> = T extends {
10
+ [brandTag]: infer U;
11
+ } ? Prettify<{
12
+ [brandTag]: U;
13
+ } & {
14
+ [P in keyof T]?: DeepOptional<T[P]>;
15
+ }> : {
5
16
  [P in keyof T]?: DeepOptional<T[P]>;
6
17
  };
18
+ export {};
7
19
  //# sourceMappingURL=deep.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deep.d.ts","sourceRoot":"","sources":["../src/deep.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KACxB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;KACzB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACtC,CAAC"}
1
+ {"version":3,"file":"deep.d.ts","sourceRoot":"","sources":["../src/deep.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC;;GAEG;AACH,QAAA,MAAM,QAAQ,cAAc,CAAC;AAE7B,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KACxB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAA;CAAE,GACzD,QAAQ,CACJ;IAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;CAAE,GAAG;KACf,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACtC,CACJ,GACD;KACK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACtC,CAAC"}
package/dist/deep.js CHANGED
@@ -1,4 +1,4 @@
1
- import './H4XPUNCM.js';
1
+ import './X43TXNZ3.js';
2
2
  import './4RNWLMHM.js';
3
3
  //# sourceMappingURL=deep.js.map
4
4
  //# sourceMappingURL=deep.js.map
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var KLAVEBFH_cjs = require('./KLAVEBFH.cjs');
4
+ var U7VZULNU_cjs = require('./U7VZULNU.cjs');
5
+
6
+ // src/deep.test-d.ts
7
+ U7VZULNU_cjs.init_cjs_shims();
8
+ KLAVEBFH_cjs.test("DeepOptional", () => {
9
+ (0, KLAVEBFH_cjs.import_expect_type.expectTypeOf)().toEqualTypeOf();
10
+ (0, KLAVEBFH_cjs.import_expect_type.expectTypeOf)().toEqualTypeOf();
11
+ (0, KLAVEBFH_cjs.import_expect_type.expectTypeOf)().toEqualTypeOf();
12
+ (0, KLAVEBFH_cjs.import_expect_type.expectTypeOf)().toEqualTypeOf();
13
+ });
14
+ //# sourceMappingURL=deep.test-d.cjs.map
15
+ //# sourceMappingURL=deep.test-d.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/deep.test-d.ts"],"names":["init_cjs_shims","test","expectTypeOf","toEqualTypeOf"],"mappings":";;;;;;AAAAA,2BAAA,EAAA;AAKAC,iBAAAA,CAAK,gBAAgB,MAAA;AAGjBC,EAAAA,IAAAA,+BAAAA,CAAAA,YAAAA,IAAkBC,aAAAA,EAAa;AAI/BD,EAAAA,IAAAA,+BAAAA,CAAAA,YAAAA,IAAkBC,aAAAA,EAAa;AAM/BD,EAAAA,IAAAA,+BAAAA,CAAAA,YAAAA,IAAkBC,aAAAA,EAAa;AAK/BD,EAAAA,IAAAA,+BAAAA,CAAAA,YAAAA,IAAkBC,aAAAA,EAAa;AASnC,CAAA,CAAA","file":"deep.test-d.cjs","sourcesContent":["import { expectTypeOf, test } from 'vitest';\n\nimport type { Branded } from './branded';\nimport type { DeepOptional } from './deep';\n\ntest('DeepOptional', () => {\n // 1 level\n type A = DeepOptional<{ a: string; b: number }>;\n expectTypeOf<A>().toEqualTypeOf<{ a?: string; b?: number }>();\n\n // 2 levels\n type B = DeepOptional<{ a: { c: string }; b: number }>;\n expectTypeOf<B>().toEqualTypeOf<{ a?: { c?: string }; b?: number }>();\n\n // 1 level with brand tag\n type obj = { a: string; b: number };\n type branded = Branded<obj, 'foo'>;\n type C = DeepOptional<branded>;\n expectTypeOf<C>().toEqualTypeOf<{ a?: string; b?: number; ___tag___: 'foo' }>();\n\n // 2 levels with brand tag\n type obj2 = { a: branded; b: number };\n type D = DeepOptional<Branded<obj2, 'foo2'>>;\n expectTypeOf<D>().toEqualTypeOf<{\n a?: {\n a?: string;\n b?: number;\n ___tag___: 'foo';\n };\n b?: number;\n ___tag___: 'foo2';\n }>();\n});\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=deep.test-d.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep.test-d.d.ts","sourceRoot":"","sources":["../src/deep.test-d.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { test, import_expect_type } from './OV67BGO6.js';
2
+ import { init_esm_shims } from './4RNWLMHM.js';
3
+
4
+ // src/deep.test-d.ts
5
+ init_esm_shims();
6
+ test("DeepOptional", () => {
7
+ (0, import_expect_type.expectTypeOf)().toEqualTypeOf();
8
+ (0, import_expect_type.expectTypeOf)().toEqualTypeOf();
9
+ (0, import_expect_type.expectTypeOf)().toEqualTypeOf();
10
+ (0, import_expect_type.expectTypeOf)().toEqualTypeOf();
11
+ });
12
+ //# sourceMappingURL=deep.test-d.js.map
13
+ //# sourceMappingURL=deep.test-d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/deep.test-d.ts"],"names":["test","expectTypeOf","toEqualTypeOf"],"mappings":";;;;AAAA,cAAA,EAAA;AAKAA,IAAAA,CAAK,gBAAgB,MAAA;AAGjBC,EAAAA,IAAAA,kBAAAA,CAAAA,YAAAA,IAAkBC,aAAAA,EAAa;AAI/BD,EAAAA,IAAAA,kBAAAA,CAAAA,YAAAA,IAAkBC,aAAAA,EAAa;AAM/BD,EAAAA,IAAAA,kBAAAA,CAAAA,YAAAA,IAAkBC,aAAAA,EAAa;AAK/BD,EAAAA,IAAAA,kBAAAA,CAAAA,YAAAA,IAAkBC,aAAAA,EAAa;AASnC,CAAA,CAAA","file":"deep.test-d.js","sourcesContent":["import { expectTypeOf, test } from 'vitest';\n\nimport type { Branded } from './branded';\nimport type { DeepOptional } from './deep';\n\ntest('DeepOptional', () => {\n // 1 level\n type A = DeepOptional<{ a: string; b: number }>;\n expectTypeOf<A>().toEqualTypeOf<{ a?: string; b?: number }>();\n\n // 2 levels\n type B = DeepOptional<{ a: { c: string }; b: number }>;\n expectTypeOf<B>().toEqualTypeOf<{ a?: { c?: string }; b?: number }>();\n\n // 1 level with brand tag\n type obj = { a: string; b: number };\n type branded = Branded<obj, 'foo'>;\n type C = DeepOptional<branded>;\n expectTypeOf<C>().toEqualTypeOf<{ a?: string; b?: number; ___tag___: 'foo' }>();\n\n // 2 levels with brand tag\n type obj2 = { a: branded; b: number };\n type D = DeepOptional<Branded<obj2, 'foo2'>>;\n expectTypeOf<D>().toEqualTypeOf<{\n a?: {\n a?: string;\n b?: number;\n ___tag___: 'foo';\n };\n b?: number;\n ___tag___: 'foo2';\n }>();\n});\n"]}
package/dist/index.cjs CHANGED
@@ -1,20 +1,20 @@
1
1
  'use strict';
2
2
 
3
+ require('./ATSF4XM5.cjs');
3
4
  require('./VLOINXK2.cjs');
5
+ require('./Q74ZLWCL.cjs');
4
6
  require('./Y53SFKBY.cjs');
5
7
  require('./FQTDMGIM.cjs');
6
8
  require('./JRGCWPQC.cjs');
7
- require('./OQCEYCFE.cjs');
9
+ require('./KLHW5WN3.cjs');
8
10
  require('./CEQAD5SY.cjs');
9
11
  require('./M2FMGCRF.cjs');
10
- require('./ATSF4XM5.cjs');
11
12
  require('./KGYIWVDZ.cjs');
12
13
  require('./44IBECAR.cjs');
13
14
  require('./BPWNPHCG.cjs');
14
- require('./PUPSLF67.cjs');
15
+ require('./LJLAUEED.cjs');
15
16
  require('./3JF2BSTM.cjs');
16
17
  require('./ZLF3Y44J.cjs');
17
- require('./Q74ZLWCL.cjs');
18
18
  var U7VZULNU_cjs = require('./U7VZULNU.cjs');
19
19
 
20
20
  // src/index.ts
package/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
+ import './GHCFU27L.js';
1
2
  import './62A6WP5R.js';
3
+ import './TDMZOP4J.js';
2
4
  import './HVKBLL5V.js';
3
5
  import './C2AO2CD6.js';
4
6
  import './FPWOFXCL.js';
5
- import './EXZ6DAVW.js';
7
+ import './7MFOZW3L.js';
6
8
  import './KUQBG2D5.js';
7
9
  import './ZPWIEOJR.js';
8
- import './GHCFU27L.js';
9
10
  import './Q3ZAC463.js';
10
11
  import './DXU6T5SS.js';
11
12
  import './3OBHE7MG.js';
12
- import './H4XPUNCM.js';
13
+ import './X43TXNZ3.js';
13
14
  import './HBKMB3K6.js';
14
15
  import './MNZ3MKHF.js';
15
- import './TDMZOP4J.js';
16
16
  import { init_esm_shims } from './4RNWLMHM.js';
17
17
 
18
18
  // src/index.ts
package/dist/strings.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- require('./OQCEYCFE.cjs');
3
+ require('./KLHW5WN3.cjs');
4
4
  require('./U7VZULNU.cjs');
5
5
 
6
6
  //# sourceMappingURL=strings.cjs.map
package/dist/strings.d.ts CHANGED
@@ -22,6 +22,6 @@ export type NormalizedHexString = Branded<typeof _NormalizedHexString, 'Normaliz
22
22
  * type D = HexStringIsTrimmed<'0x100'>; // true
23
23
  */
24
24
  export type HexStringIsTrimmed<T extends HexString> = T extends '0x0' ? true : T extends '0x' ? false : T extends `0x0${string}` ? false : true;
25
- export declare const _DecimalString: unique symbol;
26
- export type DecimalString = Branded<typeof _DecimalString, 'DecimalString'>;
25
+ export declare const _NumberString: unique symbol;
26
+ export type DecimalString = Branded<typeof _NumberString, 'DecimalString'>;
27
27
  //# sourceMappingURL=strings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,CAC3B,CAAC,SAAS,MAAM,EAChB,MAAM,SAAS,MAAM,IACrB,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC;AAEhD,MAAM,MAAM,SAAS,GAAG,KAAK,MAAM,EAAE,CAAC;AAEtC,MAAM,CAAC,OAAO,CAAC,MAAM,oBAAoB,EAAE,OAAO,MAAM,CAAC;AAEzD,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,OAAO,oBAAoB,EAAE,qBAAqB,CAAC,CAAC;AAE9F;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,SAAS,IAAI,CAAC,SAAS,KAAK,GAC/D,IAAI,GACJ,CAAC,SAAS,IAAI,GACZ,KAAK,GACL,CAAC,SAAS,MAAM,MAAM,EAAE,GACtB,KAAK,GACL,IAAI,CAAC;AAEf,MAAM,CAAC,OAAO,CAAC,MAAM,cAAc,EAAE,OAAO,MAAM,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,cAAc,EAAE,eAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,CAC3B,CAAC,SAAS,MAAM,EAChB,MAAM,SAAS,MAAM,IACrB,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC;AAEhD,MAAM,MAAM,SAAS,GAAG,KAAK,MAAM,EAAE,CAAC;AAEtC,MAAM,CAAC,OAAO,CAAC,MAAM,oBAAoB,EAAE,OAAO,MAAM,CAAC;AAEzD,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,OAAO,oBAAoB,EAAE,qBAAqB,CAAC,CAAC;AAE9F;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,SAAS,IAAI,CAAC,SAAS,KAAK,GAC/D,IAAI,GACJ,CAAC,SAAS,IAAI,GACZ,KAAK,GACL,CAAC,SAAS,MAAM,MAAM,EAAE,GACtB,KAAK,GACL,IAAI,CAAC;AAEf,MAAM,CAAC,OAAO,CAAC,MAAM,aAAa,EAAE,OAAO,MAAM,CAAC;AAElD,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,aAAa,EAAE,eAAe,CAAC,CAAC"}
package/dist/strings.js CHANGED
@@ -1,4 +1,4 @@
1
- import './EXZ6DAVW.js';
1
+ import './7MFOZW3L.js';
2
2
  import './4RNWLMHM.js';
3
3
  //# sourceMappingURL=strings.js.map
4
4
  //# sourceMappingURL=strings.js.map