You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
4.7 KiB
1 line
4.7 KiB
2 years ago
|
{"ast":null,"code":"import { KEY_PREFIX } from './constants';\nexport default function getStoredState(config) {\n var transforms = config.transforms || [];\n var storageKey = \"\".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key);\n var storage = config.storage;\n var debug = config.debug;\n var deserialize;\n\n if (config.deserialize === false) {\n deserialize = function deserialize(x) {\n return x;\n };\n } else if (typeof config.deserialize === 'function') {\n deserialize = config.deserialize;\n } else {\n deserialize = defaultDeserialize;\n }\n\n return storage.getItem(storageKey).then(function (serialized) {\n if (!serialized) return undefined;else {\n try {\n var state = {};\n var rawState = deserialize(serialized);\n Object.keys(rawState).forEach(function (key) {\n state[key] = transforms.reduceRight(function (subState, transformer) {\n return transformer.out(subState, key, rawState);\n }, deserialize(rawState[key]));\n });\n return state;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log(\"redux-persist/getStoredState: Error restoring data \".concat(serialized), err);\n throw err;\n }\n }\n });\n}\n\nfunction defaultDeserialize(serial) {\n return JSON.parse(serial);\n}","map":{"version":3,"names":["KEY_PREFIX","getStoredState","config","transforms","storageKey","concat","keyPrefix","undefined","key","storage","debug","deserialize","x","defaultDeserialize","getItem","then","serialized","state","rawState","Object","keys","forEach","reduceRight","subState","transformer","out","err","process","env","NODE_ENV","console","log","serial","JSON","parse"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/es/getStoredState.js"],"sourcesContent":["import { KEY_PREFIX } from './constants';\nexport default function getStoredState(config) {\n var transforms = config.transforms || [];\n var storageKey = \"\".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key);\n var storage = config.storage;\n var debug = config.debug;\n var deserialize;\n\n if (config.deserialize === false) {\n deserialize = function deserialize(x) {\n return x;\n };\n } else if (typeof config.deserialize === 'function') {\n deserialize = config.deserialize;\n } else {\n deserialize = defaultDeserialize;\n }\n\n return storage.getItem(storageKey).then(function (serialized) {\n if (!serialized) return undefined;else {\n try {\n var state = {};\n var rawState = deserialize(serialized);\n Object.keys(rawState).forEach(function (key) {\n state[key] = transforms.reduceRight(function (subState, transformer) {\n return transformer.out(subState, key, rawState);\n }, deserialize(rawState[key]));\n });\n return state;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log(\"redux-persist/getStoredState: Error restoring data \".concat(serialized), err);\n throw err;\n }\n }\n });\n}\n\nfunction defaultDeserialize(serial) {\n return JSON.parse(serial);\n}"],"mappings":"AAAA,SAASA,UAAT,QAA2B,aAA3B;AACA,eAAe,SAASC,cAAT,CAAwBC,MAAxB,EAAgC;EAC7C,IAAIC,UAAU,GAAGD,MAAM,CAACC,UAAP,IAAqB,EAAtC;EACA,IAAIC,UAAU,GAAG,GAAGC,MAAH,CAAUH,MAAM,CAACI,SAAP,KAAqBC,SAArB,GAAiCL,MAAM,CAACI,SAAxC,GAAoDN,UAA9D,EAA0EK,MAA1E,CAAiFH,MAAM,CAACM,GAAxF,CAAjB;EACA,IAAIC,OAAO,GAAGP,MAAM,CAACO,OAArB;EACA,IAAIC,KAAK,GAAGR,MAAM,CAACQ,KAAnB;EACA,IAAIC,WAAJ;;EAEA,IAAIT,MAAM,CAACS,WAAP,KAAuB,KAA3B,EAAkC;IAChCA,WAAW,GAAG,SAASA,WAAT,CAAqBC,CAArB,EAAwB;MACpC,OAAOA,CAAP;IACD,CAFD;EAGD,CAJD,MAIO,IAAI,OAAOV,MAAM,CAACS,WAAd,KAA8B,UAAlC,EAA8C;IACnDA,WAAW,GAAGT,MAAM,CAACS,WAArB;EACD,CAFM,MAEA;IACLA,WAAW,GAAGE,kBAAd;EACD;;EAED,OAAOJ,OAAO,CAACK,OAAR,CAAgBV,UAAhB,EAA4BW,IAA5B,CAAiC,UAAUC,UAAV,EAAsB;IAC5D,IAAI,CAACA,UAAL,EAAiB,OAAOT,SAAP,CAAjB,KAAuC;MACrC,IAAI;QACF,IAAIU,KAAK,
|