Comparing version 0.2.0 to 0.2.1
@@ -509,3 +509,4 @@ "use strict"; | ||
} | ||
const v = Buffer.from(s); | ||
const encoder = new TextEncoder(); | ||
const v = encoder.encode(s); | ||
if (dec[v[0]] === 255 || dec[v[1]] === 255 || dec[v[2]] === 255 || dec[v[3]] === 255 || dec[v[4]] === 255 || dec[v[5]] === 255 || dec[v[6]] === 255 || dec[v[7]] === 255 || dec[v[8]] === 255 || dec[v[9]] === 255 || dec[v[10]] === 255 || dec[v[11]] === 255 || dec[v[12]] === 255 || dec[v[13]] === 255 || dec[v[14]] === 255 || dec[v[15]] === 255 || dec[v[16]] === 255 || dec[v[17]] === 255 || dec[v[18]] === 255 || dec[v[19]] === 255 || dec[v[20]] === 255 || dec[v[21]] === 255 || dec[v[22]] === 255 || dec[v[23]] === 255 || dec[v[24]] === 255 || dec[v[25]] === 255) { | ||
@@ -567,2 +568,5 @@ throw new Error("Invalid base32 character"); | ||
} | ||
if (this.suffix[0] > "7") { | ||
throw new Error("Invalid suffix. First character must be in the range [0-7]"); | ||
} | ||
const unused = decode(this.suffix); | ||
@@ -569,0 +573,0 @@ } |
@@ -323,3 +323,4 @@ "use strict"; | ||
} | ||
const v = Buffer.from(s); | ||
const encoder = new TextEncoder(); | ||
const v = encoder.encode(s); | ||
if (dec[v[0]] === 255 || dec[v[1]] === 255 || dec[v[2]] === 255 || dec[v[3]] === 255 || dec[v[4]] === 255 || dec[v[5]] === 255 || dec[v[6]] === 255 || dec[v[7]] === 255 || dec[v[8]] === 255 || dec[v[9]] === 255 || dec[v[10]] === 255 || dec[v[11]] === 255 || dec[v[12]] === 255 || dec[v[13]] === 255 || dec[v[14]] === 255 || dec[v[15]] === 255 || dec[v[16]] === 255 || dec[v[17]] === 255 || dec[v[18]] === 255 || dec[v[19]] === 255 || dec[v[20]] === 255 || dec[v[21]] === 255 || dec[v[22]] === 255 || dec[v[23]] === 255 || dec[v[24]] === 255 || dec[v[25]] === 255) { | ||
@@ -326,0 +327,0 @@ throw new Error("Invalid base32 character"); |
@@ -509,3 +509,4 @@ "use strict"; | ||
} | ||
const v = Buffer.from(s); | ||
const encoder = new TextEncoder(); | ||
const v = encoder.encode(s); | ||
if (dec[v[0]] === 255 || dec[v[1]] === 255 || dec[v[2]] === 255 || dec[v[3]] === 255 || dec[v[4]] === 255 || dec[v[5]] === 255 || dec[v[6]] === 255 || dec[v[7]] === 255 || dec[v[8]] === 255 || dec[v[9]] === 255 || dec[v[10]] === 255 || dec[v[11]] === 255 || dec[v[12]] === 255 || dec[v[13]] === 255 || dec[v[14]] === 255 || dec[v[15]] === 255 || dec[v[16]] === 255 || dec[v[17]] === 255 || dec[v[18]] === 255 || dec[v[19]] === 255 || dec[v[20]] === 255 || dec[v[21]] === 255 || dec[v[22]] === 255 || dec[v[23]] === 255 || dec[v[24]] === 255 || dec[v[25]] === 255) { | ||
@@ -567,2 +568,5 @@ throw new Error("Invalid base32 character"); | ||
} | ||
if (this.suffix[0] > "7") { | ||
throw new Error("Invalid suffix. First character must be in the range [0-7]"); | ||
} | ||
const unused = decode(this.suffix); | ||
@@ -569,0 +573,0 @@ } |
@@ -509,3 +509,4 @@ "use strict"; | ||
} | ||
const v = Buffer.from(s); | ||
const encoder = new TextEncoder(); | ||
const v = encoder.encode(s); | ||
if (dec[v[0]] === 255 || dec[v[1]] === 255 || dec[v[2]] === 255 || dec[v[3]] === 255 || dec[v[4]] === 255 || dec[v[5]] === 255 || dec[v[6]] === 255 || dec[v[7]] === 255 || dec[v[8]] === 255 || dec[v[9]] === 255 || dec[v[10]] === 255 || dec[v[11]] === 255 || dec[v[12]] === 255 || dec[v[13]] === 255 || dec[v[14]] === 255 || dec[v[15]] === 255 || dec[v[16]] === 255 || dec[v[17]] === 255 || dec[v[18]] === 255 || dec[v[19]] === 255 || dec[v[20]] === 255 || dec[v[21]] === 255 || dec[v[22]] === 255 || dec[v[23]] === 255 || dec[v[24]] === 255 || dec[v[25]] === 255) { | ||
@@ -567,2 +568,5 @@ throw new Error("Invalid base32 character"); | ||
} | ||
if (this.suffix[0] > "7") { | ||
throw new Error("Invalid suffix. First character must be in the range [0-7]"); | ||
} | ||
const unused = decode(this.suffix); | ||
@@ -569,0 +573,0 @@ } |
{ | ||
"name": "typeid-js", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Official implementation of the TypeID specification in TypeScript. TypeIDs are type-safe, K-sortable, and globally unique identifiers inspired by Stripe IDs", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
186517
32
2949