@gardenfi/utils 2.0.6-beta.1 → 2.0.6-beta.11

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 (59) hide show
  1. package/dist/index100.cjs +1 -1
  2. package/dist/index100.js +5 -2
  3. package/dist/index101.cjs +1 -1
  4. package/dist/index101.js +11 -5
  5. package/dist/index102.cjs +1 -1
  6. package/dist/index102.js +2 -11
  7. package/dist/index104.cjs +1 -1
  8. package/dist/index104.js +1 -1
  9. package/dist/index15.cjs +1 -1
  10. package/dist/index15.js +1 -1
  11. package/dist/index20.cjs +1 -1
  12. package/dist/index20.js +1 -1
  13. package/dist/index21.cjs +1 -16
  14. package/dist/index21.js +30 -113
  15. package/dist/index22.cjs +16 -1
  16. package/dist/index22.js +113 -30
  17. package/dist/index53.cjs +1 -1
  18. package/dist/index53.js +1 -1
  19. package/dist/index54.cjs +1 -1
  20. package/dist/index54.js +1 -1
  21. package/dist/index55.cjs +1 -1
  22. package/dist/index55.js +1 -1
  23. package/dist/index56.cjs +1 -1
  24. package/dist/index56.js +1 -1
  25. package/dist/index57.cjs +1 -1
  26. package/dist/index57.js +1 -1
  27. package/dist/index58.cjs +1 -1
  28. package/dist/index58.js +2 -2
  29. package/dist/index6.cjs +1 -1
  30. package/dist/index6.js +12 -17
  31. package/dist/index61.cjs +1 -1
  32. package/dist/index61.js +1 -1
  33. package/dist/index66.cjs +1 -1
  34. package/dist/index66.js +1 -1
  35. package/dist/index70.cjs +1 -1
  36. package/dist/index70.js +2 -2
  37. package/dist/index83.cjs +1 -1
  38. package/dist/index83.js +3 -191
  39. package/dist/index84.cjs +1 -1
  40. package/dist/index84.js +8 -18
  41. package/dist/index85.cjs +1 -1
  42. package/dist/index85.js +191 -3
  43. package/dist/index86.cjs +1 -1
  44. package/dist/index86.js +18 -8
  45. package/dist/index9.cjs +1 -1
  46. package/dist/index9.js +1 -1
  47. package/dist/index93.cjs +1 -1
  48. package/dist/index93.js +1 -1
  49. package/dist/index95.cjs +1 -1
  50. package/dist/index95.js +11 -8
  51. package/dist/index96.cjs +1 -1
  52. package/dist/index96.js +18 -11
  53. package/dist/index97.cjs +1 -1
  54. package/dist/index97.js +8 -11
  55. package/dist/index98.cjs +1 -1
  56. package/dist/index98.js +11 -18
  57. package/dist/index99.cjs +1 -1
  58. package/dist/index99.js +2 -2
  59. package/package.json +2 -2
package/dist/index96.js CHANGED
@@ -1,15 +1,22 @@
1
- import { BaseError as o } from "./index63.js";
2
- class d extends o {
3
- constructor({ offset: r, position: s, size: e }) {
4
- super(`Slice ${s === "start" ? "starting" : "ending"} at offset "${r}" is out-of-bounds (size: ${e}).`, { name: "SliceOffsetOutOfBoundsError" });
5
- }
1
+ function o(e) {
2
+ if (/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(e) || /%[^0-9a-f]/i.test(e) || /%[0-9a-f](:?[^0-9a-f]|$)/i.test(e))
3
+ return !1;
4
+ const s = a(e), f = s[1], t = s[2], i = s[3], r = s[4], l = s[5];
5
+ if (!(f != null && f.length && i.length >= 0))
6
+ return !1;
7
+ if (t != null && t.length) {
8
+ if (!(i.length === 0 || /^\//.test(i)))
9
+ return !1;
10
+ } else if (/^\/\//.test(i))
11
+ return !1;
12
+ if (!/^[a-z][a-z0-9\+\-\.]*$/.test(f.toLowerCase()))
13
+ return !1;
14
+ let n = "";
15
+ return n += `${f}:`, t != null && t.length && (n += `//${t}`), n += i, r != null && r.length && (n += `?${r}`), l != null && l.length && (n += `#${l}`), n;
6
16
  }
7
- class n extends o {
8
- constructor({ size: r, targetSize: s, type: e }) {
9
- super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (${r}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
10
- }
17
+ function a(e) {
18
+ return e.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);
11
19
  }
12
20
  export {
13
- n as SizeExceedsPaddingSizeError,
14
- d as SliceOffsetOutOfBoundsError
21
+ o as isUri
15
22
  };
package/dist/index97.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index63.cjs");class t extends a.BaseError{constructor(e){const{docsPath:s,field:r,metaMessages:i}=e;super(`Invalid Sign-In with Ethereum message field "${r}".`,{docsPath:s,metaMessages:i,name:"SiweInvalidMessageFieldError"})}}exports.SiweInvalidMessageFieldError=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}exports.defineChain=n;
package/dist/index97.js CHANGED
@@ -1,14 +1,11 @@
1
- import { BaseError as i } from "./index63.js";
2
- class d extends i {
3
- constructor(e) {
4
- const { docsPath: s, field: r, metaMessages: a } = e;
5
- super(`Invalid Sign-In with Ethereum message field "${r}".`, {
6
- docsPath: s,
7
- metaMessages: a,
8
- name: "SiweInvalidMessageFieldError"
9
- });
10
- }
1
+ function n(e) {
2
+ return {
3
+ formatters: void 0,
4
+ fees: void 0,
5
+ serializers: void 0,
6
+ ...e
7
+ };
11
8
  }
12
9
  export {
13
- d as SiweInvalidMessageFieldError
10
+ n as defineChain
14
11
  };
package/dist/index98.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(e){if(/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(e)||/%[^0-9a-f]/i.test(e)||/%[0-9a-f](:?[^0-9a-f]|$)/i.test(e))return!1;const s=a(e),f=s[1],t=s[2],i=s[3],r=s[4],l=s[5];if(!(f!=null&&f.length&&i.length>=0))return!1;if(t!=null&&t.length){if(!(i.length===0||/^\//.test(i)))return!1}else if(/^\/\//.test(i))return!1;if(!/^[a-z][a-z0-9\+\-\.]*$/.test(f.toLowerCase()))return!1;let n="";return n+=`${f}:`,t!=null&&t.length&&(n+=`//${t}`),n+=i,r!=null&&r.length&&(n+=`?${r}`),l!=null&&l.length&&(n+=`#${l}`),n}function a(e){return e.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/)}exports.isUri=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index63.cjs");class i extends t.BaseError{constructor({offset:r,position:s,size:e}){super(`Slice ${s==="start"?"starting":"ending"} at offset "${r}" is out-of-bounds (size: ${e}).`,{name:"SliceOffsetOutOfBoundsError"})}}class d extends t.BaseError{constructor({size:r,targetSize:s,type:e}){super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (${r}) exceeds padding size (${s}).`,{name:"SizeExceedsPaddingSizeError"})}}exports.SizeExceedsPaddingSizeError=d;exports.SliceOffsetOutOfBoundsError=i;
package/dist/index98.js CHANGED
@@ -1,22 +1,15 @@
1
- function o(e) {
2
- if (/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(e) || /%[^0-9a-f]/i.test(e) || /%[0-9a-f](:?[^0-9a-f]|$)/i.test(e))
3
- return !1;
4
- const s = a(e), f = s[1], t = s[2], i = s[3], r = s[4], l = s[5];
5
- if (!(f != null && f.length && i.length >= 0))
6
- return !1;
7
- if (t != null && t.length) {
8
- if (!(i.length === 0 || /^\//.test(i)))
9
- return !1;
10
- } else if (/^\/\//.test(i))
11
- return !1;
12
- if (!/^[a-z][a-z0-9\+\-\.]*$/.test(f.toLowerCase()))
13
- return !1;
14
- let n = "";
15
- return n += `${f}:`, t != null && t.length && (n += `//${t}`), n += i, r != null && r.length && (n += `?${r}`), l != null && l.length && (n += `#${l}`), n;
1
+ import { BaseError as o } from "./index63.js";
2
+ class d extends o {
3
+ constructor({ offset: r, position: s, size: e }) {
4
+ super(`Slice ${s === "start" ? "starting" : "ending"} at offset "${r}" is out-of-bounds (size: ${e}).`, { name: "SliceOffsetOutOfBoundsError" });
5
+ }
16
6
  }
17
- function a(e) {
18
- return e.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);
7
+ class n extends o {
8
+ constructor({ size: r, targetSize: s, type: e }) {
9
+ super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (${r}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
10
+ }
19
11
  }
20
12
  export {
21
- o as isUri
13
+ n as SizeExceedsPaddingSizeError,
14
+ d as SliceOffsetOutOfBoundsError
22
15
  };
package/dist/index99.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index96.cjs"),O=require("./index85.cjs"),n=require("./index66.cjs");function p(i,e,s,{strict:f}={}){return O.isHex(i,{strict:!1})?l(i,e,s,{strict:f}):u(i,e,s,{strict:f})}function r(i,e){if(typeof e=="number"&&e>0&&e>n.size(i)-1)throw new t.SliceOffsetOutOfBoundsError({offset:e,position:"start",size:n.size(i)})}function c(i,e,s){if(typeof e=="number"&&typeof s=="number"&&n.size(i)!==s-e)throw new t.SliceOffsetOutOfBoundsError({offset:s,position:"end",size:n.size(i)})}function u(i,e,s,{strict:f}={}){r(i,e);const o=i.slice(e,s);return f&&c(o,e,s),o}function l(i,e,s,{strict:f}={}){r(i,e);const o=`0x${i.replace("0x","").slice((e??0)*2,(s??i.length)*2)}`;return f&&c(o,e,s),o}exports.slice=p;exports.sliceBytes=u;exports.sliceHex=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index98.cjs"),O=require("./index83.cjs"),n=require("./index66.cjs");function p(i,e,s,{strict:f}={}){return O.isHex(i,{strict:!1})?l(i,e,s,{strict:f}):u(i,e,s,{strict:f})}function r(i,e){if(typeof e=="number"&&e>0&&e>n.size(i)-1)throw new t.SliceOffsetOutOfBoundsError({offset:e,position:"start",size:n.size(i)})}function c(i,e,s){if(typeof e=="number"&&typeof s=="number"&&n.size(i)!==s-e)throw new t.SliceOffsetOutOfBoundsError({offset:s,position:"end",size:n.size(i)})}function u(i,e,s,{strict:f}={}){r(i,e);const o=i.slice(e,s);return f&&c(o,e,s),o}function l(i,e,s,{strict:f}={}){r(i,e);const o=`0x${i.replace("0x","").slice((e??0)*2,(s??i.length)*2)}`;return f&&c(o,e,s),o}exports.slice=p;exports.sliceBytes=u;exports.sliceHex=l;
package/dist/index99.js CHANGED
@@ -1,5 +1,5 @@
1
- import { SliceOffsetOutOfBoundsError as t } from "./index96.js";
2
- import { isHex as p } from "./index85.js";
1
+ import { SliceOffsetOutOfBoundsError as t } from "./index98.js";
2
+ import { isHex as p } from "./index83.js";
3
3
  import { size as r } from "./index66.js";
4
4
  function w(e, f, i, { strict: o } = {}) {
5
5
  return p(e, { strict: !1 }) ? u(e, f, i, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gardenfi/utils",
3
- "version": "2.0.6-beta.1",
3
+ "version": "2.0.6-beta.11",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "vite build",
@@ -35,8 +35,8 @@
35
35
  },
36
36
  "sideEffects": false,
37
37
  "dependencies": {
38
+ "@peculiar/webcrypto": "^1.5.0",
38
39
  "@simplewebauthn/browser": "^13.1.0",
39
- "crypto-browserify": "^3.12.1",
40
40
  "jwt-decode": "^4.0.0",
41
41
  "viem": "^2.21.23"
42
42
  }