e4cfe2fb998eb8a06c25cfed54bdd46a9964531c12718f2befc55083586fbf52.json 11 KB

1
  1. {"ast":null,"code":"\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs3/core-js-stable/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs3/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/promise\"));\nvar _CoreManager = _interopRequireDefault(require(\"./CoreManager\"));\nconst Storage = {\n async() {\n const controller = _CoreManager.default.getStorageController();\n return !!controller.async;\n },\n getItem(path) {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n throw new Error('Synchronous storage is not supported by the current storage controller');\n }\n return controller.getItem(path);\n },\n getItemAsync(path) {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n return controller.getItemAsync(path);\n }\n return _promise.default.resolve(controller.getItem(path));\n },\n setItem(path, value) {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n throw new Error('Synchronous storage is not supported by the current storage controller');\n }\n return controller.setItem(path, value);\n },\n setItemAsync(path, value) {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n return controller.setItemAsync(path, value);\n }\n return _promise.default.resolve(controller.setItem(path, value));\n },\n removeItem(path) {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n throw new Error('Synchronous storage is not supported by the current storage controller');\n }\n return controller.removeItem(path);\n },\n removeItemAsync(path) {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n return controller.removeItemAsync(path);\n }\n return _promise.default.resolve(controller.removeItem(path));\n },\n getAllKeys() {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n throw new Error('Synchronous storage is not supported by the current storage controller');\n }\n return controller.getAllKeys();\n },\n getAllKeysAsync() {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n return controller.getAllKeysAsync();\n }\n return _promise.default.resolve(controller.getAllKeys());\n },\n generatePath(path) {\n if (!_CoreManager.default.get('APPLICATION_ID')) {\n throw new Error('You need to call Parse.initialize before using Parse.');\n }\n if (typeof path !== 'string') {\n throw new Error('Tried to get a Storage path that was not a String.');\n }\n if (path[0] === '/') {\n path = path.substr(1);\n }\n return 'Parse/' + _CoreManager.default.get('APPLICATION_ID') + '/' + path;\n },\n _clear() {\n const controller = _CoreManager.default.getStorageController();\n if (controller.hasOwnProperty('clear')) {\n controller.clear();\n }\n }\n};\nmodule.exports = Storage;\nvar _default = exports.default = Storage;","map":{"version":3,"names":["_Object$defineProperty","require","_interopRequireDefault","exports","value","default","_promise","_CoreManager","Storage","async","controller","getStorageController","getItem","path","Error","getItemAsync","resolve","setItem","setItemAsync","removeItem","removeItemAsync","getAllKeys","getAllKeysAsync","generatePath","get","substr","_clear","hasOwnProperty","clear","module","_default"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/parse/lib/browser/Storage.js"],"sourcesContent":["\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs3/core-js-stable/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs3/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/promise\"));\nvar _CoreManager = _interopRequireDefault(require(\"./CoreManager\"));\nconst Storage = {\n async() {\n const controller = _CoreManager.default.getStorageController();\n return !!controller.async;\n },\n getItem(path) {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n throw new Error('Synchronous storage is not supported by the current storage controller');\n }\n return controller.getItem(path);\n },\n getItemAsync(path) {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n return controller.getItemAsync(path);\n }\n return _promise.default.resolve(controller.getItem(path));\n },\n setItem(path, value) {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n throw new Error('Synchronous storage is not supported by the current storage controller');\n }\n return controller.setItem(path, value);\n },\n setItemAsync(path, value) {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n return controller.setItemAsync(path, value);\n }\n return _promise.default.resolve(controller.setItem(path, value));\n },\n removeItem(path) {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n throw new Error('Synchronous storage is not supported by the current storage controller');\n }\n return controller.removeItem(path);\n },\n removeItemAsync(path) {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n return controller.removeItemAsync(path);\n }\n return _promise.default.resolve(controller.removeItem(path));\n },\n getAllKeys() {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n throw new Error('Synchronous storage is not supported by the current storage controller');\n }\n return controller.getAllKeys();\n },\n getAllKeysAsync() {\n const controller = _CoreManager.default.getStorageController();\n if (controller.async === 1) {\n return controller.getAllKeysAsync();\n }\n return _promise.default.resolve(controller.getAllKeys());\n },\n generatePath(path) {\n if (!_CoreManager.default.get('APPLICATION_ID')) {\n throw new Error('You need to call Parse.initialize before using Parse.');\n }\n if (typeof path !== 'string') {\n throw new Error('Tried to get a Storage path that was not a String.');\n }\n if (path[0] === '/') {\n path = path.substr(1);\n }\n return 'Parse/' + _CoreManager.default.get('APPLICATION_ID') + '/' + path;\n },\n _clear() {\n const controller = _CoreManager.default.getStorageController();\n if (controller.hasOwnProperty('clear')) {\n controller.clear();\n }\n }\n};\nmodule.exports = Storage;\nvar _default = exports.default = Storage;"],"mappings":"AAAA,YAAY;;AAEZ,IAAIA,sBAAsB,GAAGC,OAAO,CAAC,8DAA8D,CAAC;AACpG,IAAIC,sBAAsB,GAAGD,OAAO,CAAC,sDAAsD,CAAC;AAC5FD,sBAAsB,CAACG,OAAO,EAAE,YAAY,EAAE;EAC5CC,KAAK,EAAE;AACT,CAAC,CAAC;AACFD,OAAO,CAACE,OAAO,GAAG,KAAK,CAAC;AACxB,IAAIC,QAAQ,GAAGJ,sBA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