UNPKG

@arc-publishing/sdk-identity

Version:
34 lines 1.94 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var identity_1 = tslib_1.__importDefault(require("./identity")); var constants_1 = require("./constants"); var socialSignOnTypes_1 = require("./socialSignOnTypes"); function options(options) { var _a, _b, _c, _d, _e, _f; if (options) { identity_1.default.apiOrigin = (options.apiOrigin && options.apiOrigin.replace(/\/$/, '')) || identity_1.default.apiOrigin; identity_1.default.baseDomain = options.baseDomain || identity_1.default._baseDomain; if (options.google) { if ((0, socialSignOnTypes_1.isLegacyGoogleSetting)(options.google)) { identity_1.default._google = tslib_1.__assign(tslib_1.__assign({}, identity_1.default._google), options.google); } else { identity_1.default._google = (_a = options.google) !== null && _a !== void 0 ? _a : identity_1.default._google; } } identity_1.default.profileStorageOpt = { storageExp: ((_b = options.profileStorageOpt) === null || _b === void 0 ? void 0 : _b.storageExp) || ((_c = identity_1.default._profileStorageOpt) === null || _c === void 0 ? void 0 : _c.storageExp), ignoreProfile: ((_d = options.profileStorageOpt) === null || _d === void 0 ? void 0 : _d.ignoreProfile) !== undefined ? (_e = options.profileStorageOpt) === null || _e === void 0 ? void 0 : _e.ignoreProfile : (_f = identity_1.default._profileStorageOpt) === null || _f === void 0 ? void 0 : _f.ignoreProfile }; identity_1.default.ampReaderId = options.ampReaderId || identity_1.default.ampReaderId; } else { console.warn("".concat(constants_1.logPrefix, " No options specified when calling Identity.options")); } } exports.default = options; //# sourceMappingURL=options.js.map