This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
2021-04-02 02:24:13 +03:00

1 line
5.2 KiB
Plaintext

{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../src/Constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAEL,YAAY,EAEZ,oBAAoB,EAIpB,kBAAkB,GAEnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAEL,YAAY,EAEZ,oBAAoB,EAIpB,kBAAkB,GAEnB,CAAC;AAEF,IAAI,CAAC,iBAAiB,EAAE;IACtB,OAAO,CAAC,IAAI,CACV,wGAAwG,CACzG,CAAC;CACH;AAED,IAAI,QAAQ,GAAG,IAAI,CAAC;AACpB,gEAAgE;AAChE,IAAI,kBAAkB,CAAC,WAAW,EAAE;IAClC,IAAI,eAAe,CAAC;IACpB,IAAI,kBAAkB,CAAC,WAAW,CAAC,QAAQ,EAAE;QAC3C,eAAe,GAAG,kBAAkB,CAAC,WAAW,CAAC,QAAQ,CAAC;KAC3D;SAAM,IAAI,kBAAkB,CAAC,WAAW,CAAC,cAAc,EAAE;QACxD,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;KAC7E;IACD,IAAI,eAAe,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;QAC9D,QAAQ,GAAG,eAAe,CAAC;KAC5B;CACF;AAED,4EAA4E;AAC5E,IAAI,CAAC,QAAQ,IAAI,iBAAiB,IAAI,iBAAiB,CAAC,QAAQ,EAAE;IAChE,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC;IACtC,yEAAyE;IACzE,IAAI,OAAO,QAAQ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} from '@unimodules/core';\nimport { Platform } from 'react-native';\n\nimport {\n AndroidManifest,\n AppOwnership,\n Constants,\n ExecutionEnvironment,\n IOSManifest,\n NativeConstants,\n PlatformManifest,\n UserInterfaceIdiom,\n WebManifest,\n} from './Constants.types';\nimport ExponentConstants from './ExponentConstants';\n\nexport {\n AndroidManifest,\n AppOwnership,\n Constants,\n ExecutionEnvironment,\n IOSManifest,\n NativeConstants,\n PlatformManifest,\n UserInterfaceIdiom,\n WebManifest,\n};\n\nif (!ExponentConstants) {\n console.warn(\n \"No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?\"\n );\n}\n\nlet manifest = null;\n// If expo-updates defines a non-empty manifest, prefer that one\nif (NativeModulesProxy.ExpoUpdates) {\n let updatesManifest;\n if (NativeModulesProxy.ExpoUpdates.manifest) {\n updatesManifest = NativeModulesProxy.ExpoUpdates.manifest;\n } else if (NativeModulesProxy.ExpoUpdates.manifestString) {\n updatesManifest = JSON.parse(NativeModulesProxy.ExpoUpdates.manifestString);\n }\n if (updatesManifest && Object.keys(updatesManifest).length > 0) {\n manifest = updatesManifest;\n }\n}\n\n// Fall back to ExponentConstants.manifest if we don't have one from Updates\nif (!manifest && ExponentConstants && ExponentConstants.manifest) {\n manifest = ExponentConstants.manifest;\n // On Android we pass the manifest in JSON form so this step is necessary\n if (typeof manifest === 'string') {\n manifest = JSON.parse(manifest);\n }\n}\n\nconst { name, appOwnership, ...nativeConstants } = (ExponentConstants || {}) as any;\n\nconst constants = {\n ...nativeConstants,\n // Ensure this is null in bare workflow\n appOwnership: appOwnership ?? null,\n // Legacy aliases\n deviceId: nativeConstants.installationId,\n linkingUrl: nativeConstants.linkingUri,\n};\n\nObject.defineProperties(constants, {\n manifest: {\n enumerable: true,\n get() {\n if (!manifest) {\n const invalidManifestType = manifest === null ? 'null' : 'undefined';\n if (\n nativeConstants.executionEnvironment === ExecutionEnvironment.Bare &&\n Platform.OS !== 'web'\n ) {\n console.warn(\n `Constants.manifest is ${invalidManifestType} because the embedded app.config could not be read. Ensure that you have installed the expo-constants build scripts if you need to read from Constants.manifest.`\n );\n } else if (\n nativeConstants.executionEnvironment === ExecutionEnvironment.StoreClient ||\n nativeConstants.executionEnvironment === ExecutionEnvironment.Standalone\n ) {\n // If we somehow get here, this is a truly exceptional state to be in.\n // Constants.manifest should *always* be defined in those contexts.\n throw new CodedError(\n 'ERR_CONSTANTS_MANIFEST_UNAVAILABLE',\n `Constants.manifest is ${invalidManifestType}, must be an object.`\n );\n }\n }\n return manifest;\n },\n // This setter is only useful to mock the value for tests\n set(value) {\n manifest = value;\n },\n },\n});\n\nexport default constants as Constants;\n"]}