Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6b1dd3b

Browse files
committed
(hotfix): jsonify shouldn't set false to true
- meant to use the previous code as an alternative to using a default arg, but `!jsonify` detects false (etc), not just undefined - switched to just using a default arg, which was what I originally used before moving defaults outside of the destructuring - alternative is to check `typeof jsonify === 'undefined'` instead - default args seem to provide better typings in my experience, so stick to that for now
1 parent10d4cd7 commit6b1dd3b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎src/index.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface IOptions {
1414
typeStrToAnyMap={[key:string]:any}
1515

1616
exportconstpersist:IArgs=(name,store,options={})=>{
17-
let{storage, jsonify, whitelist, blacklist}=options
17+
let{storage, jsonify=true, whitelist, blacklist}=options
1818

1919
// use AsyncLocalStorage by default (or if localStorage was passed in)
2020
if(
@@ -30,7 +30,6 @@ export const persist: IArgs = (name, store, options = {}) => {
3030
'engine via the `storage:` option.')
3131
}
3232

33-
if(!jsonify){jsonify=true}// default to true like mobx-persist
3433
constwhitelistDict=arrToDict(whitelist)
3534
constblacklistDict=arrToDict(blacklist)
3635

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp