@adobe/alloy 2.19.0 → 2.19.1
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.
- package/README.md +4 -1
- package/libEs5/constants/libraryVersion.js +1 -1
- package/libEs5/core/edgeNetwork/mergeLifecycleResponses.js +1 -1
- package/libEs5/utils/assignConcatArrayValues.js +49 -0
- package/libEs5/utils/index.js +7 -0
- package/libEs6/constants/libraryVersion.js +1 -1
- package/libEs6/core/edgeNetwork/mergeLifecycleResponses.js +3 -2
- package/libEs6/utils/assignConcatArrayValues.js +36 -0
- package/libEs6/utils/index.js +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,4 +8,7 @@ Alloy is the code name for the Adobe Experience Platform Web SDK. It allows for
|
|
|
8
8
|
|
|
9
9
|
For documentation on how to use Alloy, please see the [user documentation](https://experienceleague.adobe.com/docs/experience-platform/edge/home.html).
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
## Contribution
|
|
13
|
+
|
|
14
|
+
Check out the [contribution guidelines](CONTRIBUTING.md) for quick start information, and head over to the [developer documentation](https://github.com/adobe/alloy/wiki) to understand the architecture and structure of the library.
|
|
@@ -14,5 +14,5 @@ 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 = "2.19.
|
|
17
|
+
var _default = "2.19.1";
|
|
18
18
|
exports.default = _default;
|
|
@@ -24,6 +24,6 @@ var _default = function _default(returnValues) {
|
|
|
24
24
|
var lifecycleOnResponseReturnValues = returnValues.shift() || [];
|
|
25
25
|
var consumerOnResponseReturnValues = returnValues.shift() || [];
|
|
26
26
|
var lifecycleOnBeforeRequestReturnValues = returnValues;
|
|
27
|
-
return _utils.
|
|
27
|
+
return _utils.assignConcatArrayValues.apply(void 0, [{}].concat(_toConsumableArray(lifecycleOnResponseReturnValues), _toConsumableArray(consumerOnResponseReturnValues), _toConsumableArray(lifecycleOnBeforeRequestReturnValues)));
|
|
28
28
|
};
|
|
29
29
|
exports.default = _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
var _assign = require("./assign");
|
|
5
|
+
var _isObject = require("./isObject");
|
|
6
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
7
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /*
|
|
12
|
+
Copyright 2023 Adobe. All rights reserved.
|
|
13
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
15
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
|
|
17
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
18
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
19
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
20
|
+
governing permissions and limitations under the License.
|
|
21
|
+
*/
|
|
22
|
+
var _default = function _default() {
|
|
23
|
+
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
24
|
+
values[_key] = arguments[_key];
|
|
25
|
+
}
|
|
26
|
+
if (values.length < 2) {
|
|
27
|
+
// if the number of args is 0 or 1, just use the default behavior from Object.assign
|
|
28
|
+
return _assign.default.apply(void 0, values);
|
|
29
|
+
}
|
|
30
|
+
return values.reduce(function (accumulator, currentValue) {
|
|
31
|
+
if ((0, _isObject.default)(currentValue)) {
|
|
32
|
+
Object.keys(currentValue).forEach(function (key) {
|
|
33
|
+
if (Array.isArray(currentValue[key])) {
|
|
34
|
+
if (Array.isArray(accumulator[key])) {
|
|
35
|
+
var _accumulator$key;
|
|
36
|
+
(_accumulator$key = accumulator[key]).push.apply(_accumulator$key, _toConsumableArray(currentValue[key]));
|
|
37
|
+
} else {
|
|
38
|
+
// clone the array so the original isn't modified.
|
|
39
|
+
accumulator[key] = _toConsumableArray(currentValue[key]);
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
accumulator[key] = currentValue[key];
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return accumulator;
|
|
47
|
+
}); // no default value to pass into reduce because we want to skip the first value
|
|
48
|
+
};
|
|
49
|
+
exports.default = _default;
|
package/libEs5/utils/index.js
CHANGED
|
@@ -12,6 +12,12 @@ Object.defineProperty(exports, "assign", {
|
|
|
12
12
|
return _assign.default;
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
+
Object.defineProperty(exports, "assignConcatArrayValues", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function get() {
|
|
18
|
+
return _assignConcatArrayValues.default;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
15
21
|
Object.defineProperty(exports, "assignIf", {
|
|
16
22
|
enumerable: true,
|
|
17
23
|
get: function get() {
|
|
@@ -344,6 +350,7 @@ Object.defineProperty(exports, "values", {
|
|
|
344
350
|
});
|
|
345
351
|
var _areThirdPartyCookiesSupportedByDefault = require("./areThirdPartyCookiesSupportedByDefault");
|
|
346
352
|
var _assign = require("./assign");
|
|
353
|
+
var _assignConcatArrayValues = require("./assignConcatArrayValues");
|
|
347
354
|
var _assignIf = require("./assignIf");
|
|
348
355
|
var _clone = require("./clone");
|
|
349
356
|
var _cookieJar = require("./cookieJar");
|
|
@@ -9,12 +9,13 @@ 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
|
-
|
|
12
|
+
|
|
13
|
+
import { assignConcatArrayValues } from "../../utils";
|
|
13
14
|
export default (returnValues => {
|
|
14
15
|
// Merges all returned objects from all `onResponse` callbacks into
|
|
15
16
|
// a single object that can later be returned to the customer.
|
|
16
17
|
const lifecycleOnResponseReturnValues = returnValues.shift() || [];
|
|
17
18
|
const consumerOnResponseReturnValues = returnValues.shift() || [];
|
|
18
19
|
const lifecycleOnBeforeRequestReturnValues = returnValues;
|
|
19
|
-
return
|
|
20
|
+
return assignConcatArrayValues({}, ...lifecycleOnResponseReturnValues, ...consumerOnResponseReturnValues, ...lifecycleOnBeforeRequestReturnValues);
|
|
20
21
|
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 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
|
+
import assign from "./assign";
|
|
13
|
+
import isObject from "./isObject";
|
|
14
|
+
export default ((...values) => {
|
|
15
|
+
if (values.length < 2) {
|
|
16
|
+
// if the number of args is 0 or 1, just use the default behavior from Object.assign
|
|
17
|
+
return assign(...values);
|
|
18
|
+
}
|
|
19
|
+
return values.reduce((accumulator, currentValue) => {
|
|
20
|
+
if (isObject(currentValue)) {
|
|
21
|
+
Object.keys(currentValue).forEach(key => {
|
|
22
|
+
if (Array.isArray(currentValue[key])) {
|
|
23
|
+
if (Array.isArray(accumulator[key])) {
|
|
24
|
+
accumulator[key].push(...currentValue[key]);
|
|
25
|
+
} else {
|
|
26
|
+
// clone the array so the original isn't modified.
|
|
27
|
+
accumulator[key] = [...currentValue[key]];
|
|
28
|
+
}
|
|
29
|
+
} else {
|
|
30
|
+
accumulator[key] = currentValue[key];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return accumulator;
|
|
35
|
+
}); // no default value to pass into reduce because we want to skip the first value
|
|
36
|
+
});
|
package/libEs6/utils/index.js
CHANGED
|
@@ -13,6 +13,7 @@ governing permissions and limitations under the License.
|
|
|
13
13
|
// Please keep in alphabetical order.
|
|
14
14
|
export { default as areThirdPartyCookiesSupportedByDefault } from "./areThirdPartyCookiesSupportedByDefault";
|
|
15
15
|
export { default as assign } from "./assign";
|
|
16
|
+
export { default as assignConcatArrayValues } from "./assignConcatArrayValues";
|
|
16
17
|
export { default as assignIf } from "./assignIf";
|
|
17
18
|
export { default as clone } from "./clone";
|
|
18
19
|
export { default as cookieJar } from "./cookieJar";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/alloy",
|
|
3
|
-
"version": "2.19.
|
|
3
|
+
"version": "2.19.1",
|
|
4
4
|
"description": "Adobe Experience Platform Web SDK",
|
|
5
5
|
"main": "libEs5/index.js",
|
|
6
6
|
"module": "libEs6/index.js",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"uuid": "^3.3.2"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@adobe/alloy": "^2.19.
|
|
73
|
+
"@adobe/alloy": "^2.19.1-beta.0",
|
|
74
74
|
"@babel/cli": "^7.12.8",
|
|
75
75
|
"@babel/core": "^7.2.2",
|
|
76
76
|
"@babel/plugin-proposal-object-rest-spread": "^7.3.2",
|