UNPKG

1.65 kBSource Map (JSON)View Raw
1{"version":3,"file":"ExpoErrorRecovery.web.js","sourceRoot":"","sources":["../src/ExpoErrorRecovery.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AAExD,SAAS,qBAAqB;IAC5B,IAAI,CAAC,QAAQ,CAAC,cAAc;QAAE,OAAO,IAAI,CAAC;IAC1C,IAAI;QACF,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACtD,YAAY,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;QAC3C,OAAO,KAAK,CAAC;KACd;IAAC,OAAO,CAAC,EAAE;QACV,8EAA8E;KAC/E;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,eAAe;IACb,IAAI,IAAI;QACN,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED,iBAAiB,CAAC,KAAa;QAC7B,IAAI,CAAC,QAAQ,CAAC,cAAc;YAAE,OAAO;QACrC,IAAI;YACF,YAAY,CAAC,OAAO,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;SAChD;QAAC,OAAO,CAAC,EAAE;YACV,8EAA8E;SAC/E;IACH,CAAC;IAED,cAAc,EAAE,qBAAqB,EAAE;CACxC,CAAC","sourcesContent":["import { Platform } from '@unimodules/core';\nconst LOCAL_STORAGE_KEY = 'EXPO_ERROR_RECOVERY_STORAGE';\n\nfunction _consumeRecoveryProps(): string | null {\n if (!Platform.isDOMAvailable) return null;\n try {\n const props = localStorage.getItem(LOCAL_STORAGE_KEY);\n localStorage.removeItem(LOCAL_STORAGE_KEY);\n return props;\n } catch (e) {\n // Catches localStorage SecurityError https://github.com/expo/expo/issues/8355\n }\n return null;\n}\n\nexport default {\n get name(): string {\n return 'ExpoErrorRecovery';\n },\n\n saveRecoveryProps(props: string): void {\n if (!Platform.isDOMAvailable) return;\n try {\n localStorage.setItem(LOCAL_STORAGE_KEY, props);\n } catch (e) {\n // Catches localStorage SecurityError https://github.com/expo/expo/issues/8355\n }\n },\n\n recoveredProps: _consumeRecoveryProps(),\n};\n"]}
\No newline at end of file