-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a patch for storejs to expose length of the store (#1694)
- Loading branch information
Showing
2 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
diff --git a/node_modules/storejs/dist/store.cjs.js b/node_modules/storejs/dist/store.cjs.js | ||
index 3de4dd1..bea302a 100644 | ||
--- a/node_modules/storejs/dist/store.cjs.js | ||
+++ b/node_modules/storejs/dist/store.cjs.js | ||
@@ -144,6 +144,9 @@ Store.prototype = { | ||
if (arr[i].indexOf(str) > -1) dt[arr[i]] = this.get(arr[i]); | ||
} | ||
return dt; | ||
+ }, | ||
+ len: function len() { | ||
+ return storage.length; | ||
} | ||
}; | ||
var _Store = null; | ||
diff --git a/node_modules/storejs/dist/store.esm.js b/node_modules/storejs/dist/store.esm.js | ||
index 9c7daf0..dcaa79f 100644 | ||
--- a/node_modules/storejs/dist/store.esm.js | ||
+++ b/node_modules/storejs/dist/store.esm.js | ||
@@ -142,6 +142,9 @@ Store.prototype = { | ||
if (arr[i].indexOf(str) > -1) dt[arr[i]] = this.get(arr[i]); | ||
} | ||
return dt; | ||
+ }, | ||
+ len: function len() { | ||
+ return storage.length; | ||
} | ||
}; | ||
var _Store = null; | ||
diff --git a/node_modules/storejs/dist/store.js b/node_modules/storejs/dist/store.js | ||
index f5d95a5..ff20315 100644 | ||
--- a/node_modules/storejs/dist/store.js | ||
+++ b/node_modules/storejs/dist/store.js | ||
@@ -148,6 +148,9 @@ | ||
if (arr[i].indexOf(str) > -1) dt[arr[i]] = this.get(arr[i]); | ||
} | ||
return dt; | ||
+ }, | ||
+ len: function len() { | ||
+ return storage.length; | ||
} | ||
}; | ||
var _Store = null; | ||
diff --git a/node_modules/storejs/types/index.d.ts b/node_modules/storejs/types/index.d.ts | ||
index 9ea1ef8..4ae8abe 100644 | ||
--- a/node_modules/storejs/types/index.d.ts | ||
+++ b/node_modules/storejs/types/index.d.ts | ||
@@ -30,6 +30,8 @@ declare class Store { | ||
search(keyword: string): Record<string, any> | ||
|
||
clear(): Store | ||
+ | ||
+ len(): number | ||
} | ||
|
||
declare let s: typeof store & Store |