{"ast":null,"code":"import { has, when } from 'ramda';\nimport Immutable from 'seamless-immutable'; // is this object already Immutable?\n\nvar isImmutable = has('asMutable'); // change this Immutable object into a JS object\n\nvar convertToJs = function convertToJs(state) {\n  return state.asMutable({\n    deep: true\n  });\n}; // optionally convert this object into a JS object if it is Immutable\n\n\nvar fromImmutable = when(isImmutable, convertToJs); // convert this JS object into an Immutable object\n\nvar toImmutable = function toImmutable(raw) {\n  return Immutable(raw);\n}; // the transform interface that redux-persist is expecting\n\n\nexport default {\n  out: function out(state) {\n    // console.log({ retrieving: state })\n    return toImmutable(state);\n  },\n  in: function _in(raw) {\n    // console.log({ storing: raw })\n    return fromImmutable(raw);\n  }\n};","map":{"version":3,"sources":["/home/marcelo/Documentos/Quenu/quenu-frontend/src/Services/ImmutablePersistenceTransform.js"],"names":["has","when","Immutable","isImmutable","convertToJs","state","asMutable","deep","fromImmutable","toImmutable","raw","out","in"],"mappings":"AAAA,SAAQA,GAAR,EAAaC,IAAb,QAAwB,OAAxB;AACA,OAAOC,SAAP,MAAsB,oBAAtB,C,CAEA;;AACA,IAAMC,WAAW,GAAGH,GAAG,CAAC,WAAD,CAAvB,C,CAEA;;AACA,IAAMI,WAAW,GAAG,SAAdA,WAAc,CAACC,KAAD;AAAA,SAAWA,KAAK,CAACC,SAAN,CAAgB;AAACC,IAAAA,IAAI,EAAE;AAAP,GAAhB,CAAX;AAAA,CAApB,C,CAEA;;;AACA,IAAMC,aAAa,GAAGP,IAAI,CAACE,WAAD,EAAcC,WAAd,CAA1B,C,CAEA;;AACA,IAAMK,WAAW,GAAG,SAAdA,WAAc,CAACC,GAAD;AAAA,SAASR,SAAS,CAACQ,GAAD,CAAlB;AAAA,CAApB,C,CAEA;;;AACA,eAAe;AACbC,EAAAA,GAAG,EAAE,aAACN,KAAD,EAAW;AACd;AACA,WAAOI,WAAW,CAACJ,KAAD,CAAlB;AACD,GAJY;AAKbO,EAAAA,EAAE,EAAE,aAACF,GAAD,EAAS;AACX;AACA,WAAOF,aAAa,CAACE,GAAD,CAApB;AACD;AARY,CAAf","sourcesContent":["import {has, when} from 'ramda';\nimport Immutable from 'seamless-immutable';\n\n// is this object already Immutable?\nconst isImmutable = has('asMutable')\n\n// change this Immutable object into a JS object\nconst convertToJs = (state) => state.asMutable({deep: true})\n\n// optionally convert this object into a JS object if it is Immutable\nconst fromImmutable = when(isImmutable, convertToJs)\n\n// convert this JS object into an Immutable object\nconst toImmutable = (raw) => Immutable(raw)\n\n// the transform interface that redux-persist is expecting\nexport default {\n  out: (state) => {\n    // console.log({ retrieving: state })\n    return toImmutable(state)\n  },\n  in: (raw) => {\n    // console.log({ storing: raw })\n    return fromImmutable(raw)\n  }\n}\n"]},"metadata":{},"sourceType":"module"}