Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
rojvv committed Feb 5, 2024
1 parent bd1f91f commit abc4542
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@mtkruto/storage-local-storage",
"version": "1.0.5",
"version": "1.0.6",
"description": "",
"main": "dist/index.js",
"license": "MIT",
"scripts": {
"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"
Expand Down
7 changes: 2 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -45,10 +45,7 @@ export class StorageLocalStorage extends Storage implements Storage {
*getMany<T>(
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();
}
Expand Down

0 comments on commit abc4542

Please sign in to comment.