Skip to content

Commit 7c24db4

Browse files
committed
feat: improve types
1 parent 81d0af3 commit 7c24db4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/util/storage.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,11 @@ class Storage<StorageRecord extends Record<string, any> = Record<string, any>> {
323323
* Some paths need to be escaped. Eg: ["dotted.path"]
324324
* @return Returns a new Storage.
325325
*/
326-
createStorage<const KeyPath extends string>(path: KeyPath): Storage<Get<StorageRecord, KeyPath>> {
326+
createStorage<StoredType extends Record<any, any>>(path: string): Storage<StoredType>;
327+
createStorage<const KeyPath extends string>(path: KeyPath): Storage<Get<StorageRecord, KeyPath>>;
328+
createStorage(path: string): Storage<any> {
327329
const childName = this.name ? `${this.name}.${path}` : path;
328-
return new Storage<Get<StorageRecord, KeyPath>>(childName, this.fs, this.path, { lodashPath: true });
330+
return new Storage(childName, this.fs, this.path, { lodashPath: true });
329331
}
330332

331333
/**

0 commit comments

Comments
 (0)