polystore 0.15.9 → 0.15.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polystore",
3
- "version": "0.15.9",
3
+ "version": "0.15.11",
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",
@@ -1,4 +1,4 @@
1
- import Client from "./Client";
1
+ import Client from "./Client.js";
2
2
 
3
3
  // Handle an API endpoint with fetch()
4
4
  export default class Api extends Client {
@@ -1,4 +1,4 @@
1
- import Client from "./Client";
1
+ import Client from "./Client.js";
2
2
 
3
3
  // Use Cloudflare's KV store
4
4
  export default class Cloudflare extends Client {
@@ -1,4 +1,4 @@
1
- import Client from "./Client";
1
+ import Client from "./Client.js";
2
2
 
3
3
  // A client that uses a single file (JSON) as a store
4
4
  export default class Cookie extends Client {
@@ -1,4 +1,4 @@
1
- import Client from "./Client";
1
+ import Client from "./Client.js";
2
2
 
3
3
  // Use a redis client to back up the store
4
4
  export default class Etcd extends Client {
@@ -1,4 +1,4 @@
1
- import Client from "./Client";
1
+ import Client from "./Client.js";
2
2
 
3
3
  // A client that uses a single file (JSON) as a store
4
4
  export default class File extends Client {
@@ -1,4 +1,4 @@
1
- import Client from "./Client";
1
+ import Client from "./Client.js";
2
2
 
3
3
  const noFileOk = (error) => {
4
4
  if (error.code === "ENOENT") return null;
@@ -1,4 +1,4 @@
1
- import Client from "./Client";
1
+ import Client from "./Client.js";
2
2
 
3
3
  // Use localForage for managing the KV
4
4
  export default class Forage extends Client {
@@ -1,4 +1,4 @@
1
- import Client from "./Client";
1
+ import Client from "./Client.js";
2
2
 
3
3
  const valueEncoding = "json";
4
4
  const notFound = (error) => {
@@ -1,4 +1,4 @@
1
- import Client from "./Client";
1
+ import Client from "./Client.js";
2
2
 
3
3
  // Use a Map() as an in-memory client
4
4
  export default class Memory extends Client {
@@ -1,4 +1,4 @@
1
- import Client from "./Client";
1
+ import Client from "./Client.js";
2
2
 
3
3
  // Use a redis client to back up the store
4
4
  export default class Redis extends Client {
@@ -1,4 +1,4 @@
1
- import Client from "./Client";
1
+ import Client from "./Client.js";
2
2
 
3
3
  // A client that uses a single file (JSON) as a store
4
4
  export default class WebStorage extends Client {
package/src/index.d.ts CHANGED
@@ -193,4 +193,17 @@ export interface Store {
193
193
  };
194
194
  }
195
195
 
196
- export default function (store?: any): Store;
196
+ /**
197
+ * Create a Store instance with the given client:
198
+ *
199
+ * ```js
200
+ * import kv from "polystore";
201
+ * const store1 = kv(new Map());
202
+ * const store2 = kv(localStorage);
203
+ * const store3 = kv(redisClient);
204
+ * const store4 = kv(yourOwnStore);
205
+ * ```
206
+ *
207
+ * **[→ Full kv() Docs](https://polystore.dev/documentation)**
208
+ */
209
+ export default function (client?: any): Store;