diff --git a/package.json b/package.json index 2a7b70a..5d0cf61 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mtkruto/storage-local-storage", - "version": "1.0.5", + "version": "1.0.6", "description": "", "main": "dist/index.js", "license": "MIT", @@ -8,8 +8,8 @@ "build": "rimraf dist/ && tsc" }, "devDependencies": { - "@mtkruto/node": "^0.1.139", - "@types/node-localstorage": "^1.3.2", + "@mtkruto/node": "^0.1.149", + "@types/node-localstorage": "^1.3.3", "node-localstorage": "^3.0.5", "rimraf": "^5.0.5", "typescript": "^5.2.2" diff --git a/src/index.ts b/src/index.ts index 760ce71..f039e4b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,7 +9,7 @@ export class StorageLocalStorage extends Storage implements Storage { constructor(prefix: string, localStorage?: LocalStorage) { if (prefix.length <= 0) { throw new Error("Empty prefix"); - } else if (!/^[0-9a-zA-Z]+$/.test(prefix)) { + } else if (!/^[\d\w]+$/.test(prefix)) { throw new Error("Unallowed prefix"); } super(); @@ -45,10 +45,7 @@ export class StorageLocalStorage extends Storage implements Storage { *getMany( filter: GetManyFilter, params?: { limit?: number; reverse?: boolean }, - ) { - let entries = Object.entries(this.#localStorage).sort(([a], [b]) => - a.localeCompare(b) - ); + ) { let entries = Object.entries(this.#localStorage).sort(([a], [b]) => a.localeCompare(b)); if (params?.reverse) { entries.reverse(); }