@chainflip/utils 0.1.0 → 0.1.1

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/string.cjs CHANGED
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var string_exports = {};
22
22
  __export(string_exports, {
23
23
  capitalize: () => capitalize,
24
+ isHex: () => isHex,
24
25
  split: () => split,
25
26
  toLowerCase: () => toLowerCase,
26
27
  toUpperCase: () => toUpperCase,
@@ -32,9 +33,11 @@ var toLowerCase = (str) => str.toLowerCase();
32
33
  var split = (str, delimiter) => str.split(delimiter);
33
34
  var capitalize = (str) => `${str.charAt(0).toUpperCase()}${str.slice(1)}`;
34
35
  var uncapitalize = (str) => `${str.charAt(0).toLowerCase()}${str.slice(1)}`;
36
+ var isHex = (str) => /^0x[\da-f]+$/i.test(str);
35
37
  // Annotate the CommonJS export names for ESM import in node:
36
38
  0 && (module.exports = {
37
39
  capitalize,
40
+ isHex,
38
41
  split,
39
42
  toLowerCase,
40
43
  toUpperCase,
package/dist/string.d.cts CHANGED
@@ -4,5 +4,6 @@ type Split<T extends string, D extends string> = T extends `${infer L}${D}${infe
4
4
  declare const split: <const T extends string, D extends string>(str: T, delimiter: D) => Split<T, D>;
5
5
  declare const capitalize: <const T extends string>(str: T) => Capitalize<T>;
6
6
  declare const uncapitalize: <const T extends string>(str: T) => Uncapitalize<T>;
7
+ declare const isHex: (str: string) => str is `0x${string}`;
7
8
 
8
- export { capitalize, split, toLowerCase, toUpperCase, uncapitalize };
9
+ export { capitalize, isHex, split, toLowerCase, toUpperCase, uncapitalize };
package/dist/string.d.ts CHANGED
@@ -4,5 +4,6 @@ type Split<T extends string, D extends string> = T extends `${infer L}${D}${infe
4
4
  declare const split: <const T extends string, D extends string>(str: T, delimiter: D) => Split<T, D>;
5
5
  declare const capitalize: <const T extends string>(str: T) => Capitalize<T>;
6
6
  declare const uncapitalize: <const T extends string>(str: T) => Uncapitalize<T>;
7
+ declare const isHex: (str: string) => str is `0x${string}`;
7
8
 
8
- export { capitalize, split, toLowerCase, toUpperCase, uncapitalize };
9
+ export { capitalize, isHex, split, toLowerCase, toUpperCase, uncapitalize };
package/dist/string.js CHANGED
@@ -4,8 +4,10 @@ var toLowerCase = (str) => str.toLowerCase();
4
4
  var split = (str, delimiter) => str.split(delimiter);
5
5
  var capitalize = (str) => `${str.charAt(0).toUpperCase()}${str.slice(1)}`;
6
6
  var uncapitalize = (str) => `${str.charAt(0).toLowerCase()}${str.slice(1)}`;
7
+ var isHex = (str) => /^0x[\da-f]+$/i.test(str);
7
8
  export {
8
9
  capitalize,
10
+ isHex,
9
11
  split,
10
12
  toLowerCase,
11
13
  toUpperCase,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainflip/utils",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",