@nice-code/util 0.5.3 → 0.5.4
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/build/index.js
CHANGED
|
@@ -206,18 +206,18 @@ function createDurableObjectStorageMethods(durableObjectStorage) {
|
|
|
206
206
|
}
|
|
207
207
|
};
|
|
208
208
|
}
|
|
209
|
-
var createDurableObjectStorageAdapter = (
|
|
209
|
+
var createDurableObjectStorageAdapter = ({
|
|
210
|
+
durableObjectStorage,
|
|
211
|
+
...options
|
|
212
|
+
}) => {
|
|
210
213
|
return new StorageAdapter({
|
|
211
214
|
methods: createDurableObjectStorageMethods(durableObjectStorage),
|
|
212
215
|
...options
|
|
213
216
|
});
|
|
214
217
|
};
|
|
215
|
-
function createDurableObjectTypedStorage(
|
|
218
|
+
function createDurableObjectTypedStorage(options) {
|
|
216
219
|
return createTypedStorage({
|
|
217
|
-
storageAdapter:
|
|
218
|
-
methods: createDurableObjectStorageMethods(durableObjectStorage),
|
|
219
|
-
keyPrefix
|
|
220
|
-
})
|
|
220
|
+
storageAdapter: createDurableObjectStorageAdapter(options)
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
223
|
// src/storage_adapter/specific/memory/memory_storage.ts
|
|
@@ -3,9 +3,12 @@ import { type IStorageAdapterMethods_Json } from "../../storage_adapter.types";
|
|
|
3
3
|
import { type ITypedStorage } from "../../typed_storage/createTypedStorage";
|
|
4
4
|
import type { IDurableObjectStorage } from "./durable_object_storage.types";
|
|
5
5
|
export declare function createDurableObjectStorageMethods(durableObjectStorage: IDurableObjectStorage): IStorageAdapterMethods_Json;
|
|
6
|
+
export type TCreateDurableObjectStorageOptions = Omit<IStorageAdapterConstructor, "methods"> & {
|
|
7
|
+
durableObjectStorage: IDurableObjectStorage;
|
|
8
|
+
};
|
|
6
9
|
/**
|
|
7
10
|
* Wraps a Durable Object's storage in the generic StorageAdapter interface, e.g. for handing to a
|
|
8
11
|
* ClientCryptoKeyLink so it can persist its keys inside the DO's own storage.
|
|
9
12
|
*/
|
|
10
|
-
export declare const createDurableObjectStorageAdapter: (durableObjectStorage
|
|
11
|
-
export declare function createDurableObjectTypedStorage<T extends Record<string, any>>(
|
|
13
|
+
export declare const createDurableObjectStorageAdapter: ({ durableObjectStorage, ...options }: TCreateDurableObjectStorageOptions) => StorageAdapter;
|
|
14
|
+
export declare function createDurableObjectTypedStorage<T extends Record<string, any>>(options: TCreateDurableObjectStorageOptions): ITypedStorage<T>;
|