@solana/keys
Advanced tools
Comparing version 2.0.0-experimental.487d81c to 2.0.0-experimental.4e091b2
@@ -24,5 +24,15 @@ import bs58 from 'bs58'; | ||
} | ||
function getBase58EncodedAddressComparator() { | ||
return new Intl.Collator("en", { | ||
caseFirst: "lower", | ||
ignorePunctuation: false, | ||
localeMatcher: "best fit", | ||
numeric: false, | ||
sensitivity: "variant", | ||
usage: "sort" | ||
}).compare; | ||
} | ||
export { assertIsBase58EncodedAddress }; | ||
export { assertIsBase58EncodedAddress, getBase58EncodedAddressComparator }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.browser.js.map |
@@ -207,4 +207,15 @@ this.globalThis = this.globalThis || {}; | ||
} | ||
function getBase58EncodedAddressComparator() { | ||
return new Intl.Collator("en", { | ||
caseFirst: "lower", | ||
ignorePunctuation: false, | ||
localeMatcher: "best fit", | ||
numeric: false, | ||
sensitivity: "variant", | ||
usage: "sort" | ||
}).compare; | ||
} | ||
exports.assertIsBase58EncodedAddress = assertIsBase58EncodedAddress; | ||
exports.getBase58EncodedAddressComparator = getBase58EncodedAddressComparator; | ||
@@ -211,0 +222,0 @@ return exports; |
@@ -24,5 +24,15 @@ import bs58 from 'bs58'; | ||
} | ||
function getBase58EncodedAddressComparator() { | ||
return new Intl.Collator("en", { | ||
caseFirst: "lower", | ||
ignorePunctuation: false, | ||
localeMatcher: "best fit", | ||
numeric: false, | ||
sensitivity: "variant", | ||
usage: "sort" | ||
}).compare; | ||
} | ||
export { assertIsBase58EncodedAddress }; | ||
export { assertIsBase58EncodedAddress, getBase58EncodedAddressComparator }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.native.js.map |
@@ -24,5 +24,15 @@ import bs58 from 'bs58'; | ||
} | ||
function getBase58EncodedAddressComparator() { | ||
return new Intl.Collator("en", { | ||
caseFirst: "lower", | ||
ignorePunctuation: false, | ||
localeMatcher: "best fit", | ||
numeric: false, | ||
sensitivity: "variant", | ||
usage: "sort" | ||
}).compare; | ||
} | ||
export { assertIsBase58EncodedAddress }; | ||
export { assertIsBase58EncodedAddress, getBase58EncodedAddressComparator }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.node.js.map |
@@ -5,5 +5,6 @@ this.globalThis = this.globalThis || {}; | ||
var S=Object.create;var m=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var $=(e,r)=>()=>(e&&(r=e(e=0)),r);var u=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var k=(e,r,n,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of q(r))!F.call(e,l)&&l!==n&&m(e,l,{get:()=>r[l],enumerable:!(p=V(r,l))||p.enumerable});return e};var G=(e,r,n)=>(n=e!=null?S(B(e)):{},k(r||!e||!e.__esModule?m(n,"default",{value:e,enumerable:!0}):n,e));var w=$(()=>{});var _=u((X,z)=>{w();function I(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var p=0;p<e.length;p++){var l=e.charAt(p),c=l.charCodeAt(0);if(r[c]!==255)throw new TypeError(l+" is ambiguous");r[c]=p;}var A=e.length,U=e.charAt(0),T=Math.log(A)/Math.log(256),D=Math.log(256)/Math.log(A);function O(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length===0)return "";for(var a=0,y=0,i=0,h=t.length;i!==h&&t[i]===0;)i++,a++;for(var d=(h-i)*D+1>>>0,o=new Uint8Array(d);i!==h;){for(var f=t[i],g=0,s=d-1;(f!==0||g<y)&&s!==-1;s--,g++)f+=256*o[s]>>>0,o[s]=f%A>>>0,f=f/A>>>0;if(f!==0)throw new Error("Non-zero carry");y=g,i++;}for(var v=d-y;v!==d&&o[v]===0;)v++;for(var b=U.repeat(a);v<d;++v)b+=e.charAt(o[v]);return b}function x(t){if(typeof t!="string")throw new TypeError("Expected String");if(t.length===0)return new Uint8Array;for(var a=0,y=0,i=0;t[a]===U;)y++,a++;for(var h=(t.length-a)*T+1>>>0,d=new Uint8Array(h);t[a];){var o=r[t.charCodeAt(a)];if(o===255)return;for(var f=0,g=h-1;(o!==0||f<i)&&g!==-1;g--,f++)o+=A*d[g]>>>0,d[g]=o%256>>>0,o=o/256>>>0;if(o!==0)throw new Error("Non-zero carry");i=f,a++;}for(var s=h-i;s!==h&&d[s]===0;)s++;for(var v=new Uint8Array(y+(h-s)),b=y;s!==h;)v[b++]=d[s++];return v}function R(t){var a=x(t);if(a)return a;throw new Error("Non-base"+A+" character")}return {encode:O,decodeUnsafe:x,decode:R}}z.exports=I;});var N=u((Z,M)=>{w();var J=_(),K="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";M.exports=J(K);});w();w();var C=G(N(),1);function L(e){try{if(e.length<32||e.length>44)throw new Error("Expected input string to decode to a byte array of length 32.");let n=C.default.decode(e).byteLength;if(n!==32)throw new Error(`Expected input string to decode to a byte array of length 32. Actual length: ${n}`)}catch(r){throw new Error(`\`${e}\` is not a base-58 encoded address`,{cause:r})}} | ||
var O=Object.create;var x=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var I=(e,r)=>()=>(e&&(r=e(e=0)),r);var U=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var $=(e,r,n,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let v of S(r))!q.call(e,v)&&v!==n&&x(e,v,{get:()=>r[v],enumerable:!(p=R(r,v))||p.enumerable});return e};var k=(e,r,n)=>(n=e!=null?O(V(e)):{},$(r||!e||!e.__esModule?x(n,"default",{value:e,enumerable:!0}):n,e));var g=I(()=>{});var _=U((X,z)=>{g();function G(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var p=0;p<e.length;p++){var v=e.charAt(p),E=v.charCodeAt(0);if(r[E]!==255)throw new TypeError(v+" is ambiguous");r[E]=p;}var A=e.length,u=e.charAt(0),T=Math.log(A)/Math.log(256),B=Math.log(256)/Math.log(A);function D(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length===0)return "";for(var a=0,y=0,s=0,d=t.length;s!==d&&t[s]===0;)s++,a++;for(var f=(d-s)*B+1>>>0,o=new Uint8Array(f);s!==d;){for(var h=t[s],w=0,i=f-1;(h!==0||w<y)&&i!==-1;i--,w++)h+=256*o[i]>>>0,o[i]=h%A>>>0,h=h/A>>>0;if(h!==0)throw new Error("Non-zero carry");y=w,s++;}for(var l=f-y;l!==f&&o[l]===0;)l++;for(var b=u.repeat(a);l<f;++l)b+=e.charAt(o[l]);return b}function m(t){if(typeof t!="string")throw new TypeError("Expected String");if(t.length===0)return new Uint8Array;for(var a=0,y=0,s=0;t[a]===u;)y++,a++;for(var d=(t.length-a)*T+1>>>0,f=new Uint8Array(d);t[a];){var o=r[t.charCodeAt(a)];if(o===255)return;for(var h=0,w=d-1;(o!==0||h<s)&&w!==-1;w--,h++)o+=A*f[w]>>>0,f[w]=o%256>>>0,o=o/256>>>0;if(o!==0)throw new Error("Non-zero carry");s=h,a++;}for(var i=d-s;i!==d&&f[i]===0;)i++;for(var l=new Uint8Array(y+(d-i)),b=y;i!==d;)l[b++]=f[i++];return l}function F(t){var a=m(t);if(a)return a;throw new Error("Non-base"+A+" character")}return {encode:D,decodeUnsafe:m,decode:F}}z.exports=G;});var M=U((Z,C)=>{g();var J=_(),K="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";C.exports=J(K);});g();g();var N=k(M(),1);function L(e){try{if(e.length<32||e.length>44)throw new Error("Expected input string to decode to a byte array of length 32.");let n=N.default.decode(e).byteLength;if(n!==32)throw new Error(`Expected input string to decode to a byte array of length 32. Actual length: ${n}`)}catch(r){throw new Error(`\`${e}\` is not a base-58 encoded address`,{cause:r})}}function P(){return new Intl.Collator("en",{caseFirst:"lower",ignorePunctuation:!1,localeMatcher:"best fit",numeric:!1,sensitivity:"variant",usage:"sort"}).compare} | ||
exports.assertIsBase58EncodedAddress = L; | ||
exports.getBase58EncodedAddressComparator = P; | ||
@@ -10,0 +11,0 @@ return exports; |
@@ -5,2 +5,3 @@ export type Base58EncodedAddress<TAddress extends string = string> = TAddress & { | ||
export declare function assertIsBase58EncodedAddress(putativeBase58EncodedAddress: string): asserts putativeBase58EncodedAddress is Base58EncodedAddress<typeof putativeBase58EncodedAddress>; | ||
export declare function getBase58EncodedAddressComparator(): (x: string, y: string) => number; | ||
//# sourceMappingURL=base58.d.ts.map |
{ | ||
"name": "@solana/keys", | ||
"version": "2.0.0-experimental.487d81c", | ||
"version": "2.0.0-experimental.4e091b2", | ||
"description": "Helpers for generating and transforming key material", | ||
@@ -49,6 +49,6 @@ "exports": { | ||
"devDependencies": { | ||
"@solana/eslint-config-solana": "^1.0.0", | ||
"@solana/eslint-config-solana": "^1.0.1", | ||
"@swc/core": "^1.3.18", | ||
"@swc/jest": "^0.2.23", | ||
"@types/jest": "^29.5.0", | ||
"@swc/jest": "^0.2.26", | ||
"@types/jest": "^29.5.1", | ||
"@typescript-eslint/eslint-plugin": "^5.57.1", | ||
@@ -63,9 +63,9 @@ "@typescript-eslint/parser": "^5.57.1", | ||
"jest-environment-jsdom": "^29.5.0", | ||
"jest-runner-eslint": "^2.0.0", | ||
"jest-runner-eslint": "^2.1.0", | ||
"jest-runner-prettier": "^1.0.0", | ||
"postcss": "^8.4.12", | ||
"prettier": "^2.7.1", | ||
"prettier": "^2.8.8", | ||
"ts-node": "^10.9.1", | ||
"tsup": "6.7.0", | ||
"typescript": "^5.0.3", | ||
"typescript": "^5.0.4", | ||
"version-from-git": "^1.1.1", | ||
@@ -72,0 +72,0 @@ "build-scripts": "0.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47806
455