@nakanoaas/uuid58 1.0.2 → 1.0.3

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/esm/encode.js CHANGED
@@ -30,7 +30,7 @@ export class Uuid58EncodeError extends Error {
30
30
  * ```
31
31
  */
32
32
  export function uuid58EncodeSafe(uuid) {
33
- const hex = uuid.replaceAll("-", "");
33
+ const hex = uuid.replace(/-/g, "");
34
34
  if (hex.length !== 32) {
35
35
  return new Uuid58EncodeError(`Invalid UUID length: expected 32 characters (excluding hyphens), got ${hex.length} characters in "${uuid}"`);
36
36
  }
package/esm/uuid58.js CHANGED
@@ -13,7 +13,7 @@ import { ALPHABET_LENGTH, BASE58_ALPHABET } from "./alphabet.js";
13
13
  * ```
14
14
  */
15
15
  export function uuid58() {
16
- let num = BigInt("0x" + crypto.randomUUID().replaceAll("-", ""));
16
+ let num = BigInt("0x" + crypto.randomUUID().replace(/-/g, ""));
17
17
  let encoded = "";
18
18
  do {
19
19
  encoded = BASE58_ALPHABET[Number(num % ALPHABET_LENGTH)] + encoded;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nakanoaas/uuid58",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A tiny, zero-dependency library for generating and converting UUIDs to Base58-encoded strings.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,8 +20,5 @@
20
20
  },
21
21
  "scripts": {},
22
22
  "sideEffects": false,
23
- "devDependencies": {
24
- "@types/node": "^20.9.0"
25
- },
26
23
  "_generatedBy": "dnt@dev"
27
24
  }
package/script/encode.js CHANGED
@@ -36,7 +36,7 @@ exports.Uuid58EncodeError = Uuid58EncodeError;
36
36
  * ```
37
37
  */
38
38
  function uuid58EncodeSafe(uuid) {
39
- const hex = uuid.replaceAll("-", "");
39
+ const hex = uuid.replace(/-/g, "");
40
40
  if (hex.length !== 32) {
41
41
  return new Uuid58EncodeError(`Invalid UUID length: expected 32 characters (excluding hyphens), got ${hex.length} characters in "${uuid}"`);
42
42
  }
package/script/uuid58.js CHANGED
@@ -16,7 +16,7 @@ const alphabet_js_1 = require("./alphabet.js");
16
16
  * ```
17
17
  */
18
18
  function uuid58() {
19
- let num = BigInt("0x" + crypto.randomUUID().replaceAll("-", ""));
19
+ let num = BigInt("0x" + crypto.randomUUID().replace(/-/g, ""));
20
20
  let encoded = "";
21
21
  do {
22
22
  encoded = alphabet_js_1.BASE58_ALPHABET[Number(num % alphabet_js_1.ALPHABET_LENGTH)] + encoded;