polystore 0.21.0 → 0.21.2
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/index.js +8 -5
- package/package.json +2 -2
- package/readme.md +1 -1
package/index.js
CHANGED
|
@@ -179,7 +179,7 @@ var File = class extends Client {
|
|
|
179
179
|
// Check if this is the right class for the given client
|
|
180
180
|
static test = (client) => {
|
|
181
181
|
if (client instanceof URL) client = client.href;
|
|
182
|
-
return typeof client === "string" && client.startsWith("file://") && client.
|
|
182
|
+
return typeof client === "string" && client.startsWith("file://") && client.endsWith(".json");
|
|
183
183
|
};
|
|
184
184
|
// We want to make sure the file already exists, so attempt to
|
|
185
185
|
// create the folders and the file (but not OVERWRITE it, that's why the x flag)
|
|
@@ -508,9 +508,12 @@ var Redis = class extends Client {
|
|
|
508
508
|
async *iterate(prefix = "") {
|
|
509
509
|
const MATCH = prefix + "*";
|
|
510
510
|
for await (const key of this.client.scanIterator({ MATCH })) {
|
|
511
|
-
const
|
|
512
|
-
|
|
513
|
-
|
|
511
|
+
const keys = typeof key === "string" ? [key] : key;
|
|
512
|
+
for (const key2 of keys) {
|
|
513
|
+
const value = await this.get(key2);
|
|
514
|
+
if (value !== null && value !== void 0) {
|
|
515
|
+
yield [key2, value];
|
|
516
|
+
}
|
|
514
517
|
}
|
|
515
518
|
}
|
|
516
519
|
}
|
|
@@ -519,7 +522,7 @@ var Redis = class extends Client {
|
|
|
519
522
|
const MATCH = prefix + "*";
|
|
520
523
|
const keys = [];
|
|
521
524
|
for await (const key of this.client.scanIterator({ MATCH })) {
|
|
522
|
-
keys.push(key);
|
|
525
|
+
keys.push(...typeof key === "string" ? [key] : key);
|
|
523
526
|
}
|
|
524
527
|
return keys;
|
|
525
528
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polystore",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.2",
|
|
4
4
|
"description": "A small compatibility layer for many popular KV stores like localStorage, Redis, FileSystem, etc.",
|
|
5
5
|
"homepage": "https://polystore.dev",
|
|
6
6
|
"repository": "https://github.com/franciscop/polystore.git",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"scripts": {
|
|
37
37
|
"analyze": "npm run build && esbuild src/index.ts --bundle --packages=external --format=esm --minify --outfile=index.min.js && echo 'Final size:' && gzip-size index.min.js && rm index.min.js",
|
|
38
38
|
"build": "bunx tsup src/index.ts --format esm --dts --out-dir . --target node24 && bunx tsup src/integrations/express.ts src/integrations/hono-sessions.ts --format esm --dts --out-dir src/integrations --target node24 --external polystore --external express-session --external hono-sessions",
|
|
39
|
-
"lint": "
|
|
39
|
+
"lint": "tsc",
|
|
40
40
|
"start": "bun test --watch",
|
|
41
41
|
"service:db": "etcd",
|
|
42
42
|
"service:redis": "brew services start redis",
|
package/readme.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Polystore [](https://www.npmjs.com/package/polystore) [](https://github.com/franciscop/polystore/
|
|
1
|
+
# Polystore [](https://www.npmjs.com/package/polystore) [](https://github.com/franciscop/polystore/actions) [](https://bundlephobia.com/package/polystore) [](https://github.com/franciscop/polystore/blob/master/package.json)
|
|
2
2
|
|
|
3
3
|
A key-value library to unify the API of [many clients](#clients): localStorage, Redis, FileSystem, SQLite, etc.
|
|
4
4
|
|