Skip to content

Commit 380bacc

Browse files
committed
Fix: LocalStorageDriver didn't use (un)serialize
1 parent 5961985 commit 380bacc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.4.1 (DEV)
4+
5+
- Fix: `createLocalStorageDriver` didn't use `serialize` and `unserialize`.
6+
37
## 0.4.0 (2023-12-06)
48

59
- **BREAKING**: Drop Node < 18.

src/localStorage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export function createLocalStorageDriver<V>(
4141
// ...options,
4242
storage: options.storage ?? window.localStorage,
4343
prefix: options.prefix ?? 'persistent',
44-
serialize: JSON.stringify,
45-
unserialize: JSON.parse,
44+
serialize: options.serialize ?? JSON.stringify,
45+
unserialize: options.unserialize ?? JSON.parse,
4646
});
4747
}
4848

0 commit comments

Comments
 (0)