@layerzerolabs/typescript-utils 4.0.7 → 4.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.
@@ -2,5 +2,5 @@ import { init_esm_shims } from './QO2PM2OB.js';
2
2
 
3
3
  // src/strings.ts
4
4
  init_esm_shims();
5
- //# sourceMappingURL=3PD4KBME.js.map
6
- //# sourceMappingURL=3PD4KBME.js.map
5
+ //# sourceMappingURL=IRQWAPPM.js.map
6
+ //# sourceMappingURL=IRQWAPPM.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/strings.ts"],"names":[],"mappings":";;;AAyCA,cAAA,EAAA","file":"3PD4KBME.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"]}
1
+ {"version":3,"sources":["../src/strings.ts"],"names":[],"mappings":";;;AA2CA,cAAA,EAAA","file":"IRQWAPPM.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\nexport type Bytes32String = Branded<HexString, 'Bytes32String'>;\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"]}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import './3PD4KBME.js';
1
+ import './IRQWAPPM.js';
2
2
  import './TQS35DMP.js';
3
3
  import './QWWHNH5G.js';
4
4
  import './OCPD34G3.js';
package/dist/strings.d.ts CHANGED
@@ -12,6 +12,7 @@ export type StringWithoutSuffix<T extends string, Suffix extends string> = T ext
12
12
  export type HexString = `0x${string}`;
13
13
  export declare const _NormalizedHexString: unique symbol;
14
14
  export type NormalizedHexString = Branded<typeof _NormalizedHexString, 'NormalizedHexString'>;
15
+ export type Bytes32String = Branded<HexString, 'Bytes32String'>;
15
16
  /**
16
17
  * Guarantees that a hex string is trimmed.
17
18
  *
@@ -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,aAAa,EAAE,OAAO,MAAM,CAAC;AAElD,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,aAAa,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,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;AAEhE;;;;;;;;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 './3PD4KBME.js';
1
+ import './IRQWAPPM.js';
2
2
  import './QO2PM2OB.js';
3
3
  //# sourceMappingURL=strings.js.map
4
4
  //# sourceMappingURL=strings.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerzerolabs/typescript-utils",
3
- "version": "4.0.7",
3
+ "version": "4.0.9",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -16,9 +16,9 @@
16
16
  "dist/**/*"
17
17
  ],
18
18
  "devDependencies": {
19
- "@layerzerolabs/tsup-configuration": "4.0.7",
20
- "@layerzerolabs/typescript-configuration": "4.0.7",
21
- "@layerzerolabs/vitest-configuration": "4.0.7",
19
+ "@layerzerolabs/tsup-configuration": "4.0.9",
20
+ "@layerzerolabs/typescript-configuration": "4.0.9",
21
+ "@layerzerolabs/vitest-configuration": "4.0.9",
22
22
  "tsup": "^8.4.0",
23
23
  "vitest": "^4.1.10"
24
24
  },