File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ export function blacklistKeys (blacklist?: Array<string>): ITransform {
44 const blacklistDict = arrToDict ( blacklist )
55
66 return { toStorage : function blacklistTransform ( snapshot ) {
7+ if ( ! blacklist ) { return snapshot }
8+
79 Object . keys ( snapshot ) . forEach ( ( key ) => {
8- if ( blacklist && blacklistDict [ key ] ) {
9- delete snapshot [ key ]
10- }
10+ if ( blacklistDict [ key ] ) { delete snapshot [ key ] }
1111 } )
1212 return snapshot
1313 } }
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ export function whitelistKeys (whitelist?: Array<string>): ITransform {
44 const whitelistDict = arrToDict ( whitelist )
55
66 return { toStorage : function whitelistTransform ( snapshot ) {
7+ if ( ! whitelist ) { return snapshot }
8+
79 Object . keys ( snapshot ) . forEach ( ( key ) => {
8- if ( whitelist && ! whitelistDict [ key ] ) {
9- delete snapshot [ key ]
10- }
10+ if ( ! whitelistDict [ key ] ) { delete snapshot [ key ] }
1111 } )
1212 return snapshot
1313 } }
You can’t perform that action at this time.
0 commit comments