| Server IP : 13.235.167.51 / Your IP : 216.73.217.116 Web Server : Apache System : Linux machinox-server 6.17.0-1013-aws #13~24.04.1-Ubuntu SMP Fri Apr 24 21:36:58 UTC 2026 aarch64 User : root ( 0) PHP Version : 8.2.29 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/control.machinox.in/node_modules/redux-persist/es/ |
Upload File : |
// @flow
type TransformConfig = {
whitelist?: Array<string>,
blacklist?: Array<string>,
}
export default function createTransform(
// @NOTE inbound: transform state coming from redux on its way to being serialized and stored
inbound: ?Function,
// @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux
outbound: ?Function,
config: TransformConfig = {}
) {
let whitelist = config.whitelist || null
let blacklist = config.blacklist || null
function whitelistBlacklistCheck(key) {
if (whitelist && whitelist.indexOf(key) === -1) return true
if (blacklist && blacklist.indexOf(key) !== -1) return true
return false
}
return {
in: (state: Object, key: string, fullState: Object) =>
!whitelistBlacklistCheck(key) && inbound
? inbound(state, key, fullState)
: state,
out: (state: Object, key: string, fullState: Object) =>
!whitelistBlacklistCheck(key) && outbound
? outbound(state, key, fullState)
: state,
}
}