5ea46776aef6813ce1b486644a39495767157babf076f276136deb42bca50d5c.json 11 KB

1
  1. {"ast":null,"code":"\"use strict\";\n\nvar _asyncToGenerator = require(\"F:/workspace/202226701027/huinongbao-app/node_modules/@babel/runtime/helpers/asyncToGenerator.js\").default;\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 _stringify = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/json/stringify\"));\nvar _CoreManager = _interopRequireDefault(require(\"./CoreManager\"));\nvar _Storage = _interopRequireDefault(require(\"./Storage\"));\nvar _ParseInstallation = _interopRequireDefault(require(\"./ParseInstallation\"));\nvar _uuid = _interopRequireDefault(require(\"./uuid\"));\nconst CURRENT_INSTALLATION_KEY = 'currentInstallation';\nconst CURRENT_INSTALLATION_ID_KEY = 'currentInstallationId';\nlet iidCache = null;\nlet currentInstallationCache = null;\nlet currentInstallationCacheMatchesDisk = false;\nconst InstallationController = {\n updateInstallationOnDisk(installation) {\n var _this = this;\n return _asyncToGenerator(function* () {\n const path = _Storage.default.generatePath(CURRENT_INSTALLATION_KEY);\n yield _Storage.default.setItemAsync(path, (0, _stringify.default)(installation.toJSON()));\n _this._setCurrentInstallationCache(installation);\n })();\n },\n currentInstallationId() {\n return _asyncToGenerator(function* () {\n if (typeof iidCache === 'string') {\n return iidCache;\n }\n const path = _Storage.default.generatePath(CURRENT_INSTALLATION_ID_KEY);\n let iid = yield _Storage.default.getItemAsync(path);\n if (!iid) {\n iid = (0, _uuid.default)();\n return _Storage.default.setItemAsync(path, iid).then(() => {\n iidCache = iid;\n return iid;\n });\n }\n iidCache = iid;\n return iid;\n })();\n },\n currentInstallation() {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n if (currentInstallationCache) {\n return currentInstallationCache;\n }\n if (currentInstallationCacheMatchesDisk) {\n return null;\n }\n const path = _Storage.default.generatePath(CURRENT_INSTALLATION_KEY);\n let installationData = yield _Storage.default.getItemAsync(path);\n currentInstallationCacheMatchesDisk = true;\n if (installationData) {\n installationData = JSON.parse(installationData);\n installationData.className = '_Installation';\n const current = _ParseInstallation.default.fromJSON(installationData);\n currentInstallationCache = current;\n return current;\n }\n const installationId = yield _this2.currentInstallationId();\n const installation = new _ParseInstallation.default();\n installation.set('deviceType', _ParseInstallation.default.DEVICE_TYPES.WEB);\n installation.set('installationId', installationId);\n installation.set('parseVersion', _CoreManager.default.get('VERSION'));\n currentInstallationCache = installation;\n yield _Storage.default.setItemAsync(path, (0, _stringify.default)(installation.toJSON()));\n return installation;\n })();\n },\n _clearCache() {\n iidCache = null;\n currentInstallationCache = null;\n currentInstallationCacheMatchesDisk = false;\n },\n _setInstallationIdCache(iid) {\n iidCache = iid;\n },\n _setCurrentInstallationCache(installation) {\n let matchesDisk = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n currentInstallationCache = installation;\n currentInstallationCacheMatchesDisk = matchesDisk;\n }\n};\nmodule.exports = InstallationController;\nvar _default = exports.default = InstallationController;","map":{"version":3,"names":["_asyncToGenerator","require","default","_Object$defineProperty","_interopRequireDefault","exports","value","_stringify","_CoreManager","_Storage","_ParseInstallation","_uuid","CURRENT_INSTALLATION_KEY","CURRENT_INSTALLATION_ID_KEY","iidCache","currentInstallationCache","currentInstallationCacheMatchesDisk","InstallationController","updateInstallationOnDisk","installation","_this","path","generatePath","setItemAsync","toJSON","_setCurrentInstallationCache","currentInstallationId","iid","getItemAsync","then","currentInstallation","_this2","installationData","JSON","parse","className","current","fromJSON","installationId","set","DEVICE_TYPES","WEB","get","_clearCache","_setInstallationIdCache","matchesDisk","arguments","length","undefined","module","_default"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/parse/lib/browser/InstallationController.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 _stringify = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/json/stringify\"));\nvar _CoreManager = _interopRequireDefault(require(\"./CoreManager\"));\nvar _Storage = _interopRequireDefault(require(\"./Storage\"));\nvar _ParseInstallation = _interopRequireDefault(require(\"./ParseInstallation\"));\nvar _uuid = _interopRequireDefault(require(\"./uuid\"));\nconst CURRENT_INSTALLATION_KEY = 'currentInstallation';\nconst CURRENT_INSTALLATION_ID_KEY = 'currentInstallationId';\nlet iidCache = null;\nlet currentInstallationCache = null;\nlet currentInstallationCacheMatchesDisk = false;\nconst InstallationController = {\n async updateInstallationOnDisk(installation) {\n const path = _Storage.default.generatePath(CURRENT_INSTALLATION_KEY);\n await _Storage.default.setItemAsync(path, (0, _stringify.default)(installation.toJSON()));\n this._setCurrentInstallationCache(installation);\n },\n async currentInstallationId() {\n if (typeof iidCache === 'string') {\n return iidCache;\n }\n const path = _Storage.default.generatePath(CURRENT_INSTALLATION_ID_KEY);\n let iid = await _Storage.default.getItemAsync(path);\n if (!iid) {\n iid = (0, _uuid.default)();\n return _Storage.default.setItemAsync(path, iid).then(() => {\n iidCache = iid;\n return iid;\n });\n }\n iidCache = iid;\n return iid;\n },\n async currentInstallation() {\n if (currentInstallationCache) {\n return currentInstallationCache;\n }\n if (currentInstallationCacheMatchesDisk) {\n return null;\n }\n const path = _Storage.default.generatePath(CURRENT_INSTALLATION_KEY);\n let installationData = await _Storage.default.getItemAsync(path);\n currentInstallationCacheMatchesDisk = true;\n if (installationData) {\n installationData = JSON.parse(installationData);\n installationData.className = '_Installation';\n const current = _ParseInstallation.default.fromJSON(installationData);\n currentInstallationCache = current;\n return current;\n }\n const installationId = await this.currentInstallationId();\n const installation = new _ParseInstallation.default();\n installation.set('deviceType', _ParseInstallation.default.DEVICE_TYPES.WEB);\n installation.set('installationId', installationId);\n installation.set('parseVersion', _CoreManager.default.get('VERSION'));\n currentInstallationCache = installation;\n await _Storage.default.setItemAsync(path, (0, _stringify.default)(installation.toJSON()));\n return installation;\n },\n _clearCache() {\n iidCache = null;\n currentInstallationCache = null;\n currentInstallationCacheMatchesDisk = false;\n },\n _setInstallationIdCache(iid) {\n iidCache = iid;\n },\n _setCurrentInstallationCache(installation) {\n let matchesDisk = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n currentInstallationCache = installation;\n currentInstallationCacheMatchesDisk = matchesDisk;\n }\n};\nmodule.exports = InstallationController;\nvar _default = exports.default = InstallationController;"],"mappings":"AAAA,YAAY;;AAAC,IAAAA,iBAAA,GAAAC,OAAA,qGAAAC,OAAA;AAEb,IAAIC,sBAAsB,GAAGF,OAAO,CAAC,8DAA8D,CAAC;AACpG,IAAIG,sBAAsB,GAAGH,OAAO,CAAC,sDAAsD,CAAC;AAC5FE,sBAAsB,CAACE,OAAO,EAAE,YAAY,EAAE;EAC5CC,KAAK,EAAE;AACT,CAAC,CAAC;AACFD,OAAO,CAACH,OAAO,GAAG,KAAK,CAAC;AACxB,IAAIK,UAAU,GAAGH,sBAAsB,CAACH,OAAO,CAAC,sDAAsD,CAAC,CAAC;AACxG,IAAIO,YAAY,GAAGJ,sBAAsB,CAACH,OAAO,CAAC,eAAe,CAAC,CAAC;AACnE,IAAIQ,QAAQ,GAAGL,sBAAsB,CAACH,OAAO,CAAC,WAAW,CAAC,CAAC;AAC3D,IAAIS,kBAAkB,GAAGN,sBAAsB,CAACH,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAC/E,IAAIU,KAAK,GAAGP,sBAAsB,CAACH,OAAO,CAAC,QAAQ,CAAC,CAAC;AACrD,MAAMW,wBAAwB,GAAG,qBAAqB;AACtD,MAAMC,2BAA2B,GAAG,uBAAuB;AAC3D,IAAIC,QAAQ,GAAG,IAAI;AACnB,IAAIC,wBAAwB,GAAG,IAAI;AACnC,IAAIC,mCAAm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