@adobe/alloy 2.22.0-alpha.2 → 2.22.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  exports.default = void 0;
4
- var _getBrowser = require("../../utils/getBrowser.js");
5
4
  var _parseUrl = require("../../utils/parseUrl.js");
6
5
  var _flattenObject = require("../../utils/flattenObject.js");
7
6
  var _libraryVersion = require("../../constants/libraryVersion.js");
@@ -18,12 +17,13 @@ governing permissions and limitations under the License.
18
17
  */
19
18
  var _default = ({
20
19
  eventRegistry,
21
- window
20
+ window,
21
+ getBrowser
22
22
  }) => {
23
23
  const pageLoadTimestamp = new Date().getTime();
24
24
  const getBrowserContext = () => {
25
25
  return {
26
- name: (0, _getBrowser.default)(window)
26
+ name: getBrowser()
27
27
  };
28
28
  };
29
29
  const getPageContext = () => {
@@ -30,7 +30,8 @@ const createDecisioningEngine = ({
30
30
  config,
31
31
  eventManager,
32
32
  createNamespacedStorage,
33
- consent
33
+ consent,
34
+ getBrowser
34
35
  }) => {
35
36
  const {
36
37
  orgId,
@@ -52,7 +53,8 @@ const createDecisioningEngine = ({
52
53
  });
53
54
  const contextProvider = (0, _createContextProvider.default)({
54
55
  eventRegistry,
55
- window
56
+ window,
57
+ getBrowser
56
58
  });
57
59
  const evaluateRulesetsCommand = (0, _createEvaluateRulesetsCommand.default)({
58
60
  contextProvider,
@@ -39,7 +39,8 @@ const createIdentity = ({
39
39
  consent,
40
40
  fireReferrerHideableImage,
41
41
  sendEdgeNetworkRequest,
42
- apexDomain
42
+ apexDomain,
43
+ getBrowser
43
44
  }) => {
44
45
  const {
45
46
  orgId,
@@ -71,9 +72,12 @@ const createIdentity = ({
71
72
  createIdentityRequest: _createIdentityRequest.default,
72
73
  globalConfigOverrides
73
74
  });
75
+ const areThirdPartyCookiesSupportedByDefault = (0, _index.injectAreThirdPartyCookiesSupportedByDefault)({
76
+ getBrowser
77
+ });
74
78
  const setDomainForInitialIdentityPayload = (0, _injectSetDomainForInitialIdentityPayload.default)({
75
79
  thirdPartyCookiesEnabled,
76
- areThirdPartyCookiesSupportedByDefault: _index.areThirdPartyCookiesSupportedByDefault
80
+ areThirdPartyCookiesSupportedByDefault
77
81
  });
78
82
  const addLegacyEcidToPayload = (0, _injectAddLegacyEcidToPayload.default)({
79
83
  getLegacyEcid: legacyIdentity.getEcid,
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  exports.default = void 0;
4
- var _getBrowser = require("../../utils/getBrowser.js");
5
4
  /*
6
5
  Copyright 2020 Adobe. All rights reserved.
7
6
  This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -18,7 +17,7 @@ var _default = ({
18
17
  areThirdPartyCookiesSupportedByDefault
19
18
  }) => {
20
19
  return request => {
21
- if (thirdPartyCookiesEnabled && areThirdPartyCookiesSupportedByDefault((0, _getBrowser.default)(window))) {
20
+ if (thirdPartyCookiesEnabled && areThirdPartyCookiesSupportedByDefault()) {
22
21
  // If third-party cookies are enabled by the customer and
23
22
  // supported by the browser, we will send the request to a
24
23
  // a third-party identification domain that allows for more accurate
@@ -14,4 +14,4 @@ governing permissions and limitations under the License.
14
14
  */
15
15
  // The __VERSION__ keyword will be replace at alloy build time with the package.json version.
16
16
  // see babel-plugin-version
17
- var _default = exports.default = "2.22.0-alpha.2";
17
+ var _default = exports.default = "2.22.0-alpha.4";
@@ -65,6 +65,9 @@ const getAssuranceValidationTokenParams = (0, _index2.createGetAssuranceValidati
65
65
  window,
66
66
  createNamespacedStorage
67
67
  });
68
+ const getBrowser = (0, _index.injectGetBrowser)({
69
+ userAgent: window.navigator.userAgent
70
+ });
68
71
  const createExecuteCommand = ({
69
72
  instanceName,
70
73
  logController: {
@@ -190,7 +193,8 @@ const createExecuteCommand = ({
190
193
  logger: componentLogger
191
194
  }),
192
195
  createNamespacedStorage,
193
- apexDomain
196
+ apexDomain,
197
+ getBrowser
194
198
  };
195
199
  }
196
200
  });
@@ -1,11 +1,5 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "areThirdPartyCookiesSupportedByDefault", {
4
- enumerable: true,
5
- get: function () {
6
- return _areThirdPartyCookiesSupportedByDefault.default;
7
- }
8
- });
9
3
  Object.defineProperty(exports, "assignConcatArrayValues", {
10
4
  enumerable: true,
11
5
  get: function () {
@@ -108,6 +102,12 @@ Object.defineProperty(exports, "groupBy", {
108
102
  return _groupBy.default;
109
103
  }
110
104
  });
105
+ Object.defineProperty(exports, "injectAreThirdPartyCookiesSupportedByDefault", {
106
+ enumerable: true,
107
+ get: function () {
108
+ return _injectAreThirdPartyCookiesSupportedByDefault.default;
109
+ }
110
+ });
111
111
  Object.defineProperty(exports, "injectDoesIdentityCookieExist", {
112
112
  enumerable: true,
113
113
  get: function () {
@@ -120,6 +120,12 @@ Object.defineProperty(exports, "injectFireReferrerHideableImage", {
120
120
  return _injectFireReferrerHideableImage.default;
121
121
  }
122
122
  });
123
+ Object.defineProperty(exports, "injectGetBrowser", {
124
+ enumerable: true,
125
+ get: function () {
126
+ return _injectGetBrowser.default;
127
+ }
128
+ });
123
129
  Object.defineProperty(exports, "injectStorage", {
124
130
  enumerable: true,
125
131
  get: function () {
@@ -198,12 +204,6 @@ Object.defineProperty(exports, "isString", {
198
204
  return _isString.default;
199
205
  }
200
206
  });
201
- Object.defineProperty(exports, "memoize", {
202
- enumerable: true,
203
- get: function () {
204
- return _memoize.default;
205
- }
206
- });
207
207
  Object.defineProperty(exports, "noop", {
208
208
  enumerable: true,
209
209
  get: function () {
@@ -294,7 +294,6 @@ Object.defineProperty(exports, "validateIdentityMap", {
294
294
  return _validateIdentityMap.default;
295
295
  }
296
296
  });
297
- var _areThirdPartyCookiesSupportedByDefault = require("./areThirdPartyCookiesSupportedByDefault.js");
298
297
  var _assignConcatArrayValues = require("./assignConcatArrayValues.js");
299
298
  var _clone = require("./clone.js");
300
299
  var _cookieJar = require("./cookieJar.js");
@@ -313,7 +312,9 @@ var _getApexDomain = require("./getApexDomain.js");
313
312
  var _getLastArrayItems = require("./getLastArrayItems.js");
314
313
  var _getNamespacedCookieName = require("./getNamespacedCookieName.js");
315
314
  var _groupBy = require("./groupBy.js");
315
+ var _injectAreThirdPartyCookiesSupportedByDefault = require("./injectAreThirdPartyCookiesSupportedByDefault.js");
316
316
  var _injectDoesIdentityCookieExist = require("./injectDoesIdentityCookieExist.js");
317
+ var _injectGetBrowser = require("./injectGetBrowser.js");
317
318
  var _injectStorage = require("./injectStorage.js");
318
319
  var _intersection = require("./intersection.js");
319
320
  var _isBoolean = require("./isBoolean.js");
@@ -327,7 +328,6 @@ var _isNil = require("./isNil.js");
327
328
  var _isNumber = require("./isNumber.js");
328
329
  var _isObject = require("./isObject.js");
329
330
  var _isString = require("./isString.js");
330
- var _memoize = require("./memoize.js");
331
331
  var _noop = require("./noop.js");
332
332
  var _parseUrl = require("./parseUrl.js");
333
333
  var _prepareConfigOverridesForEdge = require("./prepareConfigOverridesForEdge.js");
@@ -2,6 +2,7 @@
2
2
 
3
3
  exports.default = void 0;
4
4
  var _browser = require("../constants/browser.js");
5
+ var _lazy = require("./lazy.js");
5
6
  /*
6
7
  Copyright 2019 Adobe. All rights reserved.
7
8
  This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -18,5 +19,7 @@ governing permissions and limitations under the License.
18
19
  // we don't know. We also assume "unknown" browsers support third-party cookies,
19
20
  // though we don't really know that either. We're making best guesses.
20
21
  const browsersSupportingThirdPartyCookie = [_browser.CHROME, _browser.EDGE, _browser.EDGE_CHROMIUM, _browser.IE, _browser.UNKNOWN];
21
- var _default = browser => browsersSupportingThirdPartyCookie.includes(browser);
22
+ var _default = ({
23
+ getBrowser
24
+ }) => (0, _lazy.default)(() => browsersSupportingThirdPartyCookie.includes(getBrowser()));
22
25
  exports.default = _default;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  exports.default = void 0;
4
- var _memoize = require("./memoize.js");
4
+ var _lazy = require("./lazy.js");
5
5
  var _browser = require("../constants/browser.js");
6
6
  /*
7
7
  Copyright 2019 Adobe. All rights reserved.
@@ -15,33 +15,33 @@ OF ANY KIND, either express or implied. See the License for the specific languag
15
15
  governing permissions and limitations under the License.
16
16
  */
17
17
 
18
- const matchUserAgent = regexs => {
19
- return userAgent => {
20
- const keys = Object.keys(regexs);
21
- for (let i = 0; i < keys.length; i += 1) {
22
- const key = keys[i];
23
- const regex = regexs[key];
24
- if (regex.test(userAgent)) {
25
- return key;
26
- }
18
+ const matchUserAgent = (regexs, userAgent) => {
19
+ const keys = Object.keys(regexs);
20
+ for (let i = 0; i < keys.length; i += 1) {
21
+ const key = keys[i];
22
+ const regex = regexs[key];
23
+ if (regex.test(userAgent)) {
24
+ return key;
27
25
  }
28
- return _browser.UNKNOWN;
29
- };
26
+ }
27
+ return _browser.UNKNOWN;
30
28
  };
31
- var _default = exports.default = (0, _memoize.default)(window => {
32
- return matchUserAgent({
29
+ var _default = ({
30
+ userAgent
31
+ }) => {
32
+ return (0, _lazy.default)(() => matchUserAgent({
33
33
  /*
34
34
  The MIT License (MIT)
35
- Copyright (c) 2019 Damon Oehlman damon.oehlman@gmail.com
36
- Permission is hereby granted, free of charge, to any person obtaining a copy
35
+ Copyright (c) 2019 Damon Oehlman damon.oehlman@gmail.com
36
+ Permission is hereby granted, free of charge, to any person obtaining a copy
37
37
  of this software and associated documentation files (the "Software"), to
38
38
  deal in the Software without restriction, including without limitation the
39
39
  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
40
40
  sell copies of the Software, and to permit persons to whom the Software is
41
41
  furnished to do so, subject to the following conditions:
42
- The above copyright notice and this permission notice shall be included in
42
+ The above copyright notice and this permission notice shall be included in
43
43
  all copies or substantial portions of the Software.
44
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45
45
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
46
46
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
47
47
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
@@ -64,5 +64,6 @@ var _default = exports.default = (0, _memoize.default)(window => {
64
64
  [_browser.IE]: /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/,
65
65
  [_browser.SAFARI]: /Version\/([0-9\._]+).*Safari/
66
66
  /* eslint-enable */
67
- })(window.navigator.userAgent);
68
- });
67
+ }, userAgent));
68
+ };
69
+ exports.default = _default;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ exports.default = void 0;
4
+ /*
5
+ Copyright 2024 Adobe. All rights reserved.
6
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License. You may obtain a copy
8
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software distributed under
11
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
+ OF ANY KIND, either express or implied. See the License for the specific language
13
+ governing permissions and limitations under the License.
14
+ */
15
+ var _default = fn => {
16
+ let called = false;
17
+ let result;
18
+ return () => {
19
+ if (!called) {
20
+ called = true;
21
+ result = fn();
22
+ }
23
+ return result;
24
+ };
25
+ };
26
+ exports.default = _default;
@@ -9,18 +9,18 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
9
9
  OF ANY KIND, either express or implied. See the License for the specific language
10
10
  governing permissions and limitations under the License.
11
11
  */
12
- import getBrowser from "../../utils/getBrowser.js";
13
12
  import parseUrl from "../../utils/parseUrl.js";
14
13
  import flattenObject from "../../utils/flattenObject.js";
15
14
  import libraryVersion from "../../constants/libraryVersion.js";
16
15
  export default (({
17
16
  eventRegistry,
18
- window
17
+ window,
18
+ getBrowser
19
19
  }) => {
20
20
  const pageLoadTimestamp = new Date().getTime();
21
21
  const getBrowserContext = () => {
22
22
  return {
23
- name: getBrowser(window)
23
+ name: getBrowser()
24
24
  };
25
25
  };
26
26
  const getPageContext = () => {
@@ -26,7 +26,8 @@ const createDecisioningEngine = ({
26
26
  config,
27
27
  eventManager,
28
28
  createNamespacedStorage,
29
- consent
29
+ consent,
30
+ getBrowser
30
31
  }) => {
31
32
  const {
32
33
  orgId,
@@ -48,7 +49,8 @@ const createDecisioningEngine = ({
48
49
  });
49
50
  const contextProvider = createContextProvider({
50
51
  eventRegistry,
51
- window
52
+ window,
53
+ getBrowser
52
54
  });
53
55
  const evaluateRulesetsCommand = createEvaluateRulesetsCommand({
54
56
  contextProvider,
@@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
10
10
  governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import { areThirdPartyCookiesSupportedByDefault, injectDoesIdentityCookieExist, createLoggingCookieJar, cookieJar } from "../../utils/index.js";
13
+ import { injectAreThirdPartyCookiesSupportedByDefault, injectDoesIdentityCookieExist, createLoggingCookieJar, cookieJar } from "../../utils/index.js";
14
14
  import injectProcessIdSyncs from "./injectProcessIdSyncs.js";
15
15
  import configValidators from "./configValidators.js";
16
16
  import createComponent from "./createComponent.js";
@@ -36,7 +36,8 @@ const createIdentity = ({
36
36
  consent,
37
37
  fireReferrerHideableImage,
38
38
  sendEdgeNetworkRequest,
39
- apexDomain
39
+ apexDomain,
40
+ getBrowser
40
41
  }) => {
41
42
  const {
42
43
  orgId,
@@ -68,6 +69,9 @@ const createIdentity = ({
68
69
  createIdentityRequest,
69
70
  globalConfigOverrides
70
71
  });
72
+ const areThirdPartyCookiesSupportedByDefault = injectAreThirdPartyCookiesSupportedByDefault({
73
+ getBrowser
74
+ });
71
75
  const setDomainForInitialIdentityPayload = injectSetDomainForInitialIdentityPayload({
72
76
  thirdPartyCookiesEnabled,
73
77
  areThirdPartyCookiesSupportedByDefault
@@ -10,13 +10,12 @@ OF ANY KIND, either express or implied. See the License for the specific languag
10
10
  governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import getBrowser from "../../utils/getBrowser.js";
14
13
  export default (({
15
14
  thirdPartyCookiesEnabled,
16
15
  areThirdPartyCookiesSupportedByDefault
17
16
  }) => {
18
17
  return request => {
19
- if (thirdPartyCookiesEnabled && areThirdPartyCookiesSupportedByDefault(getBrowser(window))) {
18
+ if (thirdPartyCookiesEnabled && areThirdPartyCookiesSupportedByDefault()) {
20
19
  // If third-party cookies are enabled by the customer and
21
20
  // supported by the browser, we will send the request to a
22
21
  // a third-party identification domain that allows for more accurate
@@ -13,4 +13,4 @@ governing permissions and limitations under the License.
13
13
  // The __VERSION__ keyword will be replace at alloy build time with the package.json version.
14
14
  // see babel-plugin-version
15
15
 
16
- export default "2.22.0-alpha.2";
16
+ export default "2.22.0-alpha.4";
@@ -11,7 +11,7 @@ governing permissions and limitations under the License.
11
11
  */
12
12
 
13
13
  import createInstanceFunction from "./createInstanceFunction.js";
14
- import { getApexDomain, injectStorage, cookieJar, isFunction, createLoggingCookieJar, injectFireReferrerHideableImage } from "../utils/index.js";
14
+ import { getApexDomain, injectStorage, cookieJar, isFunction, createLoggingCookieJar, injectFireReferrerHideableImage, injectGetBrowser } from "../utils/index.js";
15
15
  import createLogController from "./createLogController.js";
16
16
  import createLifecycle from "./createLifecycle.js";
17
17
  import createComponentRegistry from "./createComponentRegistry.js";
@@ -62,6 +62,9 @@ const getAssuranceValidationTokenParams = createGetAssuranceValidationTokenParam
62
62
  window,
63
63
  createNamespacedStorage
64
64
  });
65
+ const getBrowser = injectGetBrowser({
66
+ userAgent: window.navigator.userAgent
67
+ });
65
68
  export const createExecuteCommand = ({
66
69
  instanceName,
67
70
  logController: {
@@ -187,7 +190,8 @@ export const createExecuteCommand = ({
187
190
  logger: componentLogger
188
191
  }),
189
192
  createNamespacedStorage,
190
- apexDomain
193
+ apexDomain,
194
+ getBrowser
191
195
  };
192
196
  }
193
197
  });
@@ -11,7 +11,6 @@ governing permissions and limitations under the License.
11
11
  */
12
12
 
13
13
  // Please keep in alphabetical order.
14
- export { default as areThirdPartyCookiesSupportedByDefault } from "./areThirdPartyCookiesSupportedByDefault.js";
15
14
  export { default as assignConcatArrayValues } from "./assignConcatArrayValues.js";
16
15
  export { default as clone } from "./clone.js";
17
16
  export { default as cookieJar } from "./cookieJar.js";
@@ -30,7 +29,9 @@ export { default as getApexDomain } from "./getApexDomain.js";
30
29
  export { default as getLastArrayItems } from "./getLastArrayItems.js";
31
30
  export { default as getNamespacedCookieName } from "./getNamespacedCookieName.js";
32
31
  export { default as groupBy } from "./groupBy.js";
32
+ export { default as injectAreThirdPartyCookiesSupportedByDefault } from "./injectAreThirdPartyCookiesSupportedByDefault.js";
33
33
  export { default as injectDoesIdentityCookieExist } from "./injectDoesIdentityCookieExist.js";
34
+ export { default as injectGetBrowser } from "./injectGetBrowser.js";
34
35
  export { default as injectStorage } from "./injectStorage.js";
35
36
  export { default as intersection } from "./intersection.js";
36
37
  export { default as isBoolean } from "./isBoolean.js";
@@ -44,7 +45,6 @@ export { default as isNil } from "./isNil.js";
44
45
  export { default as isNumber } from "./isNumber.js";
45
46
  export { default as isObject } from "./isObject.js";
46
47
  export { default as isString } from "./isString.js";
47
- export { default as memoize } from "./memoize.js";
48
48
  export { default as noop } from "./noop.js";
49
49
  export { default as parseUrl } from "./parseUrl.js";
50
50
  export { default as prepareConfigOverridesForEdge } from "./prepareConfigOverridesForEdge.js";
@@ -11,9 +11,12 @@ governing permissions and limitations under the License.
11
11
  */
12
12
 
13
13
  import { CHROME, EDGE, EDGE_CHROMIUM, IE, UNKNOWN } from "../constants/browser.js";
14
+ import lazy from "./lazy.js";
14
15
 
15
16
  // Users could have also disabled third-party cookies within these browsers, but
16
17
  // we don't know. We also assume "unknown" browsers support third-party cookies,
17
18
  // though we don't really know that either. We're making best guesses.
18
19
  const browsersSupportingThirdPartyCookie = [CHROME, EDGE, EDGE_CHROMIUM, IE, UNKNOWN];
19
- export default (browser => browsersSupportingThirdPartyCookie.includes(browser));
20
+ export default (({
21
+ getBrowser
22
+ }) => lazy(() => browsersSupportingThirdPartyCookie.includes(getBrowser())));
@@ -10,35 +10,35 @@ OF ANY KIND, either express or implied. See the License for the specific languag
10
10
  governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import memoize from "./memoize.js";
13
+ import lazy from "./lazy.js";
14
14
  import { EDGE, EDGE_CHROMIUM, CHROME, FIREFOX, IE, SAFARI, UNKNOWN } from "../constants/browser.js";
15
- const matchUserAgent = regexs => {
16
- return userAgent => {
17
- const keys = Object.keys(regexs);
18
- for (let i = 0; i < keys.length; i += 1) {
19
- const key = keys[i];
20
- const regex = regexs[key];
21
- if (regex.test(userAgent)) {
22
- return key;
23
- }
15
+ const matchUserAgent = (regexs, userAgent) => {
16
+ const keys = Object.keys(regexs);
17
+ for (let i = 0; i < keys.length; i += 1) {
18
+ const key = keys[i];
19
+ const regex = regexs[key];
20
+ if (regex.test(userAgent)) {
21
+ return key;
24
22
  }
25
- return UNKNOWN;
26
- };
23
+ }
24
+ return UNKNOWN;
27
25
  };
28
- export default memoize(window => {
29
- return matchUserAgent({
26
+ export default (({
27
+ userAgent
28
+ }) => {
29
+ return lazy(() => matchUserAgent({
30
30
  /*
31
31
  The MIT License (MIT)
32
- Copyright (c) 2019 Damon Oehlman damon.oehlman@gmail.com
33
- Permission is hereby granted, free of charge, to any person obtaining a copy
32
+ Copyright (c) 2019 Damon Oehlman damon.oehlman@gmail.com
33
+ Permission is hereby granted, free of charge, to any person obtaining a copy
34
34
  of this software and associated documentation files (the "Software"), to
35
35
  deal in the Software without restriction, including without limitation the
36
36
  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
37
37
  sell copies of the Software, and to permit persons to whom the Software is
38
38
  furnished to do so, subject to the following conditions:
39
- The above copyright notice and this permission notice shall be included in
39
+ The above copyright notice and this permission notice shall be included in
40
40
  all copies or substantial portions of the Software.
41
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
41
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42
42
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43
43
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44
44
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
@@ -61,5 +61,5 @@ export default memoize(window => {
61
61
  [IE]: /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/,
62
62
  [SAFARI]: /Version\/([0-9\._]+).*Safari/
63
63
  /* eslint-enable */
64
- })(window.navigator.userAgent);
64
+ }, userAgent));
65
65
  });
@@ -0,0 +1,22 @@
1
+ /*
2
+ Copyright 2024 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+ export default (fn => {
13
+ let called = false;
14
+ let result;
15
+ return () => {
16
+ if (!called) {
17
+ called = true;
18
+ result = fn();
19
+ }
20
+ return result;
21
+ };
22
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/alloy",
3
- "version": "2.22.0-alpha.2",
3
+ "version": "2.22.0-alpha.4",
4
4
  "description": "Adobe Experience Platform Web SDK",
5
5
  "type": "module",
6
6
  "main": "libEs5/index.js",
@@ -95,7 +95,7 @@
95
95
  "uuid": "^10.0.0"
96
96
  },
97
97
  "devDependencies": {
98
- "@adobe/alloy": "^2.22.0-alpha.1",
98
+ "@adobe/alloy": "^2.22.0-alpha.3",
99
99
  "@babel/cli": "^7.24.8",
100
100
  "@babel/plugin-transform-runtime": "^7.24.7",
101
101
  "@eslint/js": "^9.9.0",
@@ -229,7 +229,7 @@ const getInteractiveBuildCommand = () =>
229
229
  console.error(
230
230
  "Prompt couldn't be rendered in the current environment",
231
231
  );
232
- } else {
232
+ } else if (error.name !== "ExitPromptError") {
233
233
  console.error("An error occurred: ", error);
234
234
  }
235
235
  });
@@ -1,37 +0,0 @@
1
- "use strict";
2
-
3
- exports.default = void 0;
4
- /*
5
- Copyright 2019 Adobe. All rights reserved.
6
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
- you may not use this file except in compliance with the License. You may obtain a copy
8
- of the License at http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software distributed under
11
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
- OF ANY KIND, either express or implied. See the License for the specific language
13
- governing permissions and limitations under the License.
14
- */
15
- /**
16
- * Creates a function that memoizes the result of `fn`. If `keyResolver` is
17
- * provided, it determines the cache key for storing the result based on the
18
- * arguments provided to the memoized function. By default, the first argument
19
- * provided to the memoized function is used as the map cache key.
20
- *
21
- * @param {Function} fn The function to have its output memoized.
22
- * @param {Function} [keyResolver] The function to resolve the cache key.
23
- * @returns {Function} The new memoized function.
24
- */
25
- var _default = (fn, keyResolver) => {
26
- const map = new Map();
27
- return (...args) => {
28
- const key = keyResolver ? keyResolver(...args) : args[0];
29
- if (map.has(key)) {
30
- return map.get(key);
31
- }
32
- const result = fn(...args);
33
- map.set(key, result);
34
- return result;
35
- };
36
- };
37
- exports.default = _default;
@@ -1,34 +0,0 @@
1
- /*
2
- Copyright 2019 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
-
13
- /**
14
- * Creates a function that memoizes the result of `fn`. If `keyResolver` is
15
- * provided, it determines the cache key for storing the result based on the
16
- * arguments provided to the memoized function. By default, the first argument
17
- * provided to the memoized function is used as the map cache key.
18
- *
19
- * @param {Function} fn The function to have its output memoized.
20
- * @param {Function} [keyResolver] The function to resolve the cache key.
21
- * @returns {Function} The new memoized function.
22
- */
23
- export default ((fn, keyResolver) => {
24
- const map = new Map();
25
- return (...args) => {
26
- const key = keyResolver ? keyResolver(...args) : args[0];
27
- if (map.has(key)) {
28
- return map.get(key);
29
- }
30
- const result = fn(...args);
31
- map.set(key, result);
32
- return result;
33
- };
34
- });