@layerzerolabs/typescript-utils 0.0.0 → 0.0.9

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.
Files changed (106) hide show
  1. package/.turbo/turbo-build.log +97 -121
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/dist/{HKAX3PXE.cjs → 3JF2BSTM.cjs} +2 -2
  4. package/dist/3JF2BSTM.cjs.map +1 -0
  5. package/dist/{XM743A75.js → 6EIKSOH2.js} +3 -3
  6. package/dist/{XM743A75.js.map → 6EIKSOH2.js.map} +1 -1
  7. package/dist/{TML6PHUW.js → H4XPUNCM.js} +2 -2
  8. package/dist/H4XPUNCM.js.map +1 -0
  9. package/dist/{N3MJTAM7.js → HBKMB3K6.js} +2 -2
  10. package/dist/HBKMB3K6.js.map +1 -0
  11. package/dist/{GKC44C4P.cjs → LSUYSAW6.cjs} +2 -2
  12. package/dist/{GKC44C4P.cjs.map → LSUYSAW6.cjs.map} +1 -1
  13. package/dist/{7MFOZW3L.js → LXPGE3ZL.js} +2 -2
  14. package/dist/LXPGE3ZL.js.map +1 -0
  15. package/dist/{KLHW5WN3.cjs → ODTE4REV.cjs} +2 -2
  16. package/dist/ODTE4REV.cjs.map +1 -0
  17. package/dist/{B77ZZJ5J.cjs → PUPSLF67.cjs} +2 -2
  18. package/dist/PUPSLF67.cjs.map +1 -0
  19. package/dist/{KGYIWVDZ.cjs → SENCD7PY.cjs} +2 -2
  20. package/dist/SENCD7PY.cjs.map +1 -0
  21. package/dist/{AMF2EES3.cjs → TFOJQQVJ.cjs} +3 -3
  22. package/dist/{AMF2EES3.cjs.map → TFOJQQVJ.cjs.map} +1 -1
  23. package/dist/{Q3ZAC463.js → TLQZHLGH.js} +2 -2
  24. package/dist/TLQZHLGH.js.map +1 -0
  25. package/dist/{BLALMGVL.js → YICPCKYH.js} +2 -2
  26. package/dist/{BLALMGVL.js.map → YICPCKYH.js.map} +1 -1
  27. package/dist/advancedRecord.cjs +1 -1
  28. package/dist/advancedRecord.d.ts +2 -1
  29. package/dist/advancedRecord.d.ts.map +1 -1
  30. package/dist/advancedRecord.js +1 -1
  31. package/dist/deep.cjs +1 -1
  32. package/dist/deep.d.ts +1 -16
  33. package/dist/deep.d.ts.map +1 -1
  34. package/dist/deep.js +1 -1
  35. package/dist/disallowedAny.cjs +1 -1
  36. package/dist/disallowedAny.d.ts +1 -1
  37. package/dist/disallowedAny.d.ts.map +1 -1
  38. package/dist/disallowedAny.js +1 -1
  39. package/dist/index.cjs +8 -10
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.d.ts +0 -2
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +8 -10
  44. package/dist/index.js.map +1 -1
  45. package/dist/strings.cjs +1 -1
  46. package/dist/strings.d.ts +0 -16
  47. package/dist/strings.d.ts.map +1 -1
  48. package/dist/strings.js +1 -1
  49. package/dist/strings.test-d.cjs +8437 -11
  50. package/dist/strings.test-d.cjs.map +1 -1
  51. package/dist/strings.test-d.js +8434 -8
  52. package/dist/strings.test-d.js.map +1 -1
  53. package/dist/tuples.cjs +1 -1
  54. package/dist/tuples.d.ts +0 -6
  55. package/dist/tuples.d.ts.map +1 -1
  56. package/dist/tuples.js +1 -1
  57. package/package.json +6 -5
  58. package/src/advancedRecord.ts +1 -1
  59. package/src/deep.ts +3 -22
  60. package/src/disallowedAny.ts +1 -2
  61. package/src/index.ts +0 -2
  62. package/src/strings.test-d.ts +1 -12
  63. package/src/strings.ts +0 -29
  64. package/src/tuples.ts +0 -17
  65. package/tsconfig.json +9 -1
  66. package/dist/62A6WP5R.js +0 -6
  67. package/dist/62A6WP5R.js.map +0 -1
  68. package/dist/7MFOZW3L.js.map +0 -1
  69. package/dist/AYCOZKHR.js +0 -8435
  70. package/dist/AYCOZKHR.js.map +0 -1
  71. package/dist/B77ZZJ5J.cjs.map +0 -1
  72. package/dist/HKAX3PXE.cjs.map +0 -1
  73. package/dist/KGYIWVDZ.cjs.map +0 -1
  74. package/dist/KLHW5WN3.cjs.map +0 -1
  75. package/dist/MNZ3MKHF.js +0 -6
  76. package/dist/MNZ3MKHF.js.map +0 -1
  77. package/dist/N3MJTAM7.js.map +0 -1
  78. package/dist/Q3ERQ4ME.cjs +0 -8438
  79. package/dist/Q3ERQ4ME.cjs.map +0 -1
  80. package/dist/Q3ZAC463.js.map +0 -1
  81. package/dist/TML6PHUW.js.map +0 -1
  82. package/dist/VLOINXK2.cjs +0 -8
  83. package/dist/VLOINXK2.cjs.map +0 -1
  84. package/dist/ZLF3Y44J.cjs +0 -8
  85. package/dist/ZLF3Y44J.cjs.map +0 -1
  86. package/dist/deep.test-d.cjs +0 -15
  87. package/dist/deep.test-d.cjs.map +0 -1
  88. package/dist/deep.test-d.d.ts +0 -2
  89. package/dist/deep.test-d.d.ts.map +0 -1
  90. package/dist/deep.test-d.js +0 -13
  91. package/dist/deep.test-d.js.map +0 -1
  92. package/dist/identity.cjs +0 -7
  93. package/dist/identity.cjs.map +0 -1
  94. package/dist/identity.d.ts +0 -2
  95. package/dist/identity.d.ts.map +0 -1
  96. package/dist/identity.js +0 -4
  97. package/dist/identity.js.map +0 -1
  98. package/dist/withRequired.cjs +0 -7
  99. package/dist/withRequired.cjs.map +0 -1
  100. package/dist/withRequired.d.ts +0 -7
  101. package/dist/withRequired.d.ts.map +0 -1
  102. package/dist/withRequired.js +0 -4
  103. package/dist/withRequired.js.map +0 -1
  104. package/src/deep.test-d.ts +0 -33
  105. package/src/identity.ts +0 -2
  106. package/src/withRequired.ts +0 -5
package/dist/tuples.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- require('./GKC44C4P.cjs');
3
+ require('./LSUYSAW6.cjs');
4
4
  require('./U7VZULNU.cjs');
5
5
 
6
6
  //# sourceMappingURL=tuples.cjs.map
package/dist/tuples.d.ts CHANGED
@@ -2,10 +2,4 @@ import type { BrandedError } from './branded';
2
2
  export type IsComplete<T extends readonly (string | number | symbol)[], K extends string | number | symbol> = Exclude<K, T[number]> extends never ? true : false;
3
3
  export type TryGetDuplicate<T extends readonly (string | number | symbol)[], Seen extends (string | number | symbol)[] = []> = T extends [infer Head, ...infer Tail] ? Head extends Seen[number] ? Head : Head extends string | number | symbol ? Tail extends readonly (string | number | symbol)[] ? TryGetDuplicate<Tail, [...Seen, Head]> : false : false : false;
4
4
  export type AssertUniqueCompleteSet<T extends readonly (string | number | symbol)[], AllKeys extends string | number | symbol> = IsComplete<T, AllKeys> extends false ? BrandedError<`Missing key: ${Exclude<AllKeys extends Symbol ? 'ERR' : AllKeys, T[number]>}`> : TryGetDuplicate<T> extends false ? T : BrandedError<`Duplicate key found: ${TryGetDuplicate<T>}`>;
5
- type BuildTupleHelper<Element, Length extends number, Rest extends Element[]> = Rest['length'] extends Length ? readonly [...Rest] : BuildTupleHelper<Element, Length, [Element, ...Rest]>;
6
- export type BuildTuple<Element, Length extends number> = number extends Length ? readonly Element[] : BuildTupleHelper<Element, Length, []>;
7
- export type TuplesToObject<T extends readonly (readonly [PropertyKey, any])[]> = {
8
- [K in T[number] as K[0]]: K[1];
9
- };
10
- export {};
11
5
  //# sourceMappingURL=tuples.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tuples.d.ts","sourceRoot":"","sources":["../src/tuples.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG9C,MAAM,MAAM,UAAU,CAClB,CAAC,SAAS,SAAS,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,EAC/C,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,IAClC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,KAAK,GAAG,IAAI,GAAG,KAAK,CAAC;AAEvD,MAAM,MAAM,eAAe,CACvB,CAAC,SAAS,SAAS,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,EAC/C,IAAI,SAAS,CAAC,MA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CAAC,SAAS,SAAS,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,EAC/C,OAAO,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,IAExC,UAAU,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,KAAK,GAC9B,YAAY,CAAC,gBAAgB,OAAO,CAAC,OAAO,SAAS,MAAM,GAAG,KAAK,GAAG,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAC5F,eAAe,CAAC,CAAC,CAAC,SAAS,KAAK,GAC9B,CAAC,GACD,YAAY,CAAC,wBAAwB,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC"}
package/dist/tuples.js CHANGED
@@ -1,4 +1,4 @@
1
- import './BLALMGVL.js';
1
+ import './YICPCKYH.js';
2
2
  import './4RNWLMHM.js';
3
3
  //# sourceMappingURL=tuples.js.map
4
4
  //# sourceMappingURL=tuples.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerzerolabs/typescript-utils",
3
- "version": "0.0.0",
3
+ "version": "0.0.9",
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.0.1",
20
- "@layerzerolabs/typescript-configuration": "0.0.0"
19
+ "@layerzerolabs/typescript-configuration": "0.0.9",
20
+ "@layerzerolabs/tsup-configuration": "0.0.9"
21
21
  },
22
22
  "publishConfig": {
23
23
  "access": "restricted",
@@ -25,8 +25,9 @@
25
25
  },
26
26
  "scripts": {
27
27
  "build": "tsup",
28
- "checkdeps": "pnpm --filter @layerzerolabs/depcheck run depcheck validate --catalog --missing-dependencies --only $npm_package_name",
29
28
  "clean": "rm -rf ./node_modules .turbo ./dist",
30
- "lint": "eslint . --max-warnings 0 || (eslint . --fix --max-warnings 0 && false)"
29
+ "dev": "tsup --watch",
30
+ "lint": "eslint . --max-warnings 0",
31
+ "lint:fix": "eslint . --fix --max-warnings 0"
31
32
  }
32
33
  }
@@ -2,7 +2,7 @@ export type AdvancedRecord<T = any, U = any> = {
2
2
  readonly [key: string]: readonly [T, U];
3
3
  };
4
4
 
5
- export type DeepWritable<T> = { -readonly [P in keyof T]: DeepWritable<T[P]> };
5
+ type DeepWritable<T> = { -readonly [P in keyof T]: DeepWritable<T[P]> };
6
6
 
7
7
  export type AdvancedRecordLookup<
8
8
  AR extends AdvancedRecord | undefined,
package/src/deep.ts CHANGED
@@ -1,26 +1,7 @@
1
- import type { Prettify } from './viem';
2
-
3
- /**
4
- * Copy the brand tag from the branded.ts file, can't import it to keep it hidden from library users
5
- */
6
- const brandTag = '___tag___';
7
-
8
1
  export type DeepRequire<T> = {
9
2
  [P in keyof T]-?: DeepRequire<T[P]>;
10
3
  };
11
4
 
12
- export type DeepOptional<T> = T extends { [brandTag]: infer V }
13
- ? Prettify<
14
- { [brandTag]: V } & {
15
- [P in keyof T]?: DeepOptional<T[P]>;
16
- }
17
- >
18
- : {
19
- [P in keyof T]?: DeepOptional<T[P]>;
20
- };
21
-
22
- export type DeepUnion<T, U> =
23
- | {
24
- [P in keyof T]: DeepUnion<T[P], U>;
25
- }
26
- | U;
5
+ export type DeepOptional<T> = {
6
+ [P in keyof T]?: DeepOptional<T[P]>;
7
+ };
@@ -1,5 +1,4 @@
1
1
  type IsAnyInner<T> = T extends never ? true : false;
2
+ type IsAny<T> = IsAnyInner<T> extends true ? false : IsAnyInner<T> extends false ? false : true;
2
3
 
3
- export type IsAny<T> =
4
- IsAnyInner<T> extends true ? false : IsAnyInner<T> extends false ? false : true;
5
4
  export type DisallowedAny<T> = IsAny<T> extends true ? never : T;
package/src/index.ts CHANGED
@@ -3,7 +3,6 @@ export * from './branded';
3
3
  export * from './constructor';
4
4
  export * from './deep';
5
5
  export * from './disallowedAny';
6
- export * from './identity';
7
6
  export * from './lastOf';
8
7
  export * from './merge';
9
8
  export * from './methodOf';
@@ -12,4 +11,3 @@ export * from './strings';
12
11
  export * from './tuples';
13
12
  export * from './valueOf';
14
13
  export * from './viem';
15
- export * from './withRequired';
@@ -1,6 +1,6 @@
1
1
  import { expectTypeOf, test } from 'vitest';
2
2
 
3
- import type { HexStringIsTrimmed, StringWithoutSuffix } from './strings';
3
+ import type { StringWithoutSuffix } from './strings';
4
4
 
5
5
  test('StringWithoutSuffix', () => {
6
6
  type A = StringWithoutSuffix<'hello', 'world'>;
@@ -19,14 +19,3 @@ test('StringWithoutSuffix', () => {
19
19
  type E = StringWithoutSuffix<'hello world!', 'lo' | 'world'>;
20
20
  expectTypeOf<E>().toBeString();
21
21
  });
22
-
23
- test('HexStringIsTrimmed', () => {
24
- type A = HexStringIsTrimmed<'0x0'>;
25
- expectTypeOf<A>().toExtend<true>();
26
-
27
- type B = HexStringIsTrimmed<'0x00'>;
28
- expectTypeOf<B>().toExtend<false>();
29
-
30
- type C = HexStringIsTrimmed<'0x'>;
31
- expectTypeOf<C>().toExtend<false>();
32
- });
package/src/strings.ts CHANGED
@@ -1,5 +1,3 @@
1
- import type { Branded } from './branded';
2
-
3
1
  /**
4
2
  * Guarantees that a string does not end with a suffix.
5
3
  * You can remove multiple suffixes by using a union.
@@ -13,30 +11,3 @@ export type StringWithoutSuffix<
13
11
  T extends string,
14
12
  Suffix extends string,
15
13
  > = T extends `${infer _}${Suffix}` ? never : T;
16
-
17
- export type HexString = `0x${string}`;
18
-
19
- export declare const _NormalizedHexString: unique symbol;
20
-
21
- export type NormalizedHexString = Branded<typeof _NormalizedHexString, 'NormalizedHexString'>;
22
-
23
- /**
24
- * Guarantees that a hex string is trimmed.
25
- *
26
- * @example
27
- * type A = HexStringIsTrimmed<'0x0'>; // true
28
- * type B = HexStringIsTrimmed<'0x00'>; // false
29
- * type C = HexStringIsTrimmed<'0x'>; // false
30
- * type D = HexStringIsTrimmed<'0x100'>; // true
31
- */
32
- export type HexStringIsTrimmed<T extends HexString> = T extends '0x0'
33
- ? true
34
- : T extends '0x'
35
- ? false
36
- : T extends `0x0${string}`
37
- ? false
38
- : true;
39
-
40
- export declare const _NumberString: unique symbol;
41
-
42
- export type DecimalString = Branded<typeof _NumberString, 'DecimalString'>;
package/src/tuples.ts CHANGED
@@ -30,20 +30,3 @@ export type AssertUniqueCompleteSet<
30
30
  : TryGetDuplicate<T> extends false
31
31
  ? T
32
32
  : BrandedError<`Duplicate key found: ${TryGetDuplicate<T>}`>;
33
-
34
- type BuildTupleHelper<
35
- Element,
36
- Length extends number,
37
- Rest extends Element[],
38
- > = Rest['length'] extends Length
39
- ? readonly [...Rest] // Terminate with readonly array (aka tuple)
40
- : BuildTupleHelper<Element, Length, [Element, ...Rest]>;
41
-
42
- export type BuildTuple<Element, Length extends number> = number extends Length
43
- ? // Because `Length extends number` and `number extends Length`, then `Length` is not a specific finite number.
44
- readonly Element[] // It's not fixed length.
45
- : BuildTupleHelper<Element, Length, []>; // Otherwise it is a fixed length tuple.
46
-
47
- export type TuplesToObject<T extends readonly (readonly [PropertyKey, any])[]> = {
48
- [K in T[number] as K[0]]: K[1];
49
- };
package/tsconfig.json CHANGED
@@ -16,5 +16,13 @@
16
16
  "**/*.test.ts",
17
17
  "dist"
18
18
  ],
19
- "include": ["src/**/*"]
19
+ "include": ["src/**/*"],
20
+ "ts-node": {
21
+ "files": true,
22
+ "experimentalResolverFeatures": true,
23
+ "compilerOptions": {
24
+ "module": "CommonJS",
25
+ "types": ["node"]
26
+ }
27
+ }
20
28
  }
package/dist/62A6WP5R.js DELETED
@@ -1,6 +0,0 @@
1
- import { init_esm_shims } from './4RNWLMHM.js';
2
-
3
- // src/withRequired.ts
4
- init_esm_shims();
5
- //# sourceMappingURL=62A6WP5R.js.map
6
- //# sourceMappingURL=62A6WP5R.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/withRequired.ts"],"names":[],"mappings":";;;AAEA,cAAA,EAAA","file":"62A6WP5R.js","sourcesContent":["export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };\n\nexport type AllRequired<T> = {\n [K in keyof T]-?: T[K];\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/strings.ts"],"names":[],"mappings":";;;AAyCA,cAAA,EAAA","file":"7MFOZW3L.js","sourcesContent":["import type { Branded } from './branded';\n\n/**\n * Guarantees that a string does not end with a suffix.\n * You can remove multiple suffixes by using a union.\n *\n * @example\n * type A = StringWithoutSuffix<'hello', 'world'>; // 'hello'\n * type B = StringWithoutSuffix<'hello', 'lo'>; // never\n * type C = StringWithoutSuffix<'hello world', 'lo' | 'world'>; // never\n */\nexport type StringWithoutSuffix<\n T extends string,\n Suffix extends string,\n> = T extends `${infer _}${Suffix}` ? never : T;\n\nexport type HexString = `0x${string}`;\n\nexport declare const _NormalizedHexString: unique symbol;\n\nexport type NormalizedHexString = Branded<typeof _NormalizedHexString, 'NormalizedHexString'>;\n\n/**\n * Guarantees that a hex string is trimmed.\n *\n * @example\n * type A = HexStringIsTrimmed<'0x0'>; // true\n * type B = HexStringIsTrimmed<'0x00'>; // false\n * type C = HexStringIsTrimmed<'0x'>; // false\n * type D = HexStringIsTrimmed<'0x100'>; // true\n */\nexport type HexStringIsTrimmed<T extends HexString> = T extends '0x0'\n ? true\n : T extends '0x'\n ? false\n : T extends `0x0${string}`\n ? false\n : true;\n\nexport declare const _NumberString: unique symbol;\n\nexport type DecimalString = Branded<typeof _NumberString, 'DecimalString'>;\n"]}