one
Version:
One is a React framework for web, iOS, and Android apps.
1 lines • 3.13 kB
Source Map (JSON)
{"version":3,"file":"validate.js","names":[],"sources":["esm/platform/secure-store/validate.js"],"sourcesContent":["function assertSecureStoreKey(key, verb) {\n if (typeof key !== \"string\" || key.length === 0) {\n throw new Error(`${verb}: key must be a non-empty string`);\n }\n}\nfunction assertSecureStoreValue(value, verb) {\n if (typeof value !== \"string\") {\n throw new Error(`${verb}: value must be a string`);\n }\n}\nconst SECURE_STORE_ACCESSIBILITIES = [\n \"afterFirstUnlock\",\n \"afterFirstUnlockThisDeviceOnly\",\n \"always\",\n \"alwaysThisDeviceOnly\",\n \"whenPasscodeSetThisDeviceOnly\",\n \"whenUnlocked\",\n \"whenUnlockedThisDeviceOnly\"\n];\nfunction assertSecureStoreOptions(options, verb) {\n if (options === void 0) return {};\n if (typeof options !== \"object\" || options === null || Array.isArray(options)) {\n throw new Error(`${verb}: options must be an object`);\n }\n const { keychainService, keychainAccessible, requireAuthentication, authenticationPrompt, accessGroup } = options;\n if (keychainService !== void 0 && typeof keychainService !== \"string\") {\n throw new Error(`${verb}: options.keychainService must be a string`);\n }\n if (keychainAccessible !== void 0 && !SECURE_STORE_ACCESSIBILITIES.includes(keychainAccessible)) {\n throw new Error(\n `${verb}: options.keychainAccessible must be one of: ${SECURE_STORE_ACCESSIBILITIES.join(\", \")}`\n );\n }\n if (requireAuthentication !== void 0 && typeof requireAuthentication !== \"boolean\") {\n throw new Error(`${verb}: options.requireAuthentication must be a boolean`);\n }\n if (authenticationPrompt !== void 0 && typeof authenticationPrompt !== \"string\") {\n throw new Error(`${verb}: options.authenticationPrompt must be a string`);\n }\n if (accessGroup !== void 0 && typeof accessGroup !== \"string\") {\n throw new Error(`${verb}: options.accessGroup must be a string`);\n }\n return options;\n}\nexport {\n SECURE_STORE_ACCESSIBILITIES,\n assertSecureStoreKey,\n assertSecureStoreOptions,\n assertSecureStoreValue\n};\n//# sourceMappingURL=validate.js.map\n"],"mappings":";AAAA,SAAS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