@adobe/alloy 2.14.0-alpha.12 → 2.14.0-alpha.13

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.
@@ -6,17 +6,20 @@ var _utils = require("../../utils");
6
6
 
7
7
  var _highEntropyUserAgentClientHints = require("../../constants/highEntropyUserAgentClientHints");
8
8
 
9
- /*
10
- Copyright 2022 Adobe. All rights reserved.
11
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
12
- you may not use this file except in compliance with the License. You may obtain a copy
13
- of the License at http://www.apache.org/licenses/LICENSE-2.0
14
-
15
- Unless required by applicable law or agreed to in writing, software distributed under
16
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
17
- OF ANY KIND, either express or implied. See the License for the specific language
18
- governing permissions and limitations under the License.
19
- */
9
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
10
+
11
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
+
13
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
+
15
+ 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); }
16
+
17
+ 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; }
18
+
19
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
20
+
21
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
+
20
23
  var browserSupportsUserAgentClientHints = function browserSupportsUserAgentClientHints(navigator) {
21
24
  return typeof navigator.userAgentData !== "undefined";
22
25
  };
@@ -28,12 +31,20 @@ var _default = function _default(navigator) {
28
31
 
29
32
  return function (xdm, logger) {
30
33
  try {
31
- return navigator.userAgentData.getHighEntropyValues(_highEntropyUserAgentClientHints.default).then(function (hints) {
34
+ return navigator.userAgentData.getHighEntropyValues(_highEntropyUserAgentClientHints.default.map(function (hint) {
35
+ return hint[0];
36
+ })).then(function (hints) {
32
37
  var userAgentClientHints = {};
33
38
 
34
- _highEntropyUserAgentClientHints.default.forEach(function (hint) {
35
- if (Object.prototype.hasOwnProperty.call(hints, hint)) {
36
- userAgentClientHints[hint] = hints[hint];
39
+ _highEntropyUserAgentClientHints.default.forEach(function (_ref) {
40
+ var _ref2 = _slicedToArray(_ref, 2),
41
+ hintName = _ref2[0],
42
+ hintType = _ref2[1];
43
+
44
+ if (Object.prototype.hasOwnProperty.call(hints, hintName) &&
45
+ /* eslint-disable-next-line valid-typeof */
46
+ _typeof(hints[hintName]) === hintType) {
47
+ userAgentClientHints[hintName] = hints[hintName];
37
48
  }
38
49
  });
39
50
 
@@ -13,5 +13,5 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
13
13
  OF ANY KIND, either express or implied. See the License for the specific language
14
14
  governing permissions and limitations under the License.
15
15
  */
16
- var _default = ["architecture", "bitness", "model", "platformVersion", "wow64"];
16
+ var _default = [["architecture", "string"], ["bitness", "string"], ["model", "string"], ["platformVersion", "string"], ["wow64", "boolean"]];
17
17
  exports.default = _default;
@@ -15,5 +15,5 @@ governing permissions and limitations under the License.
15
15
  */
16
16
  // The __VERSION__ keyword will be replace at alloy build time with the package.json version.
17
17
  // see babel-plugin-version
18
- var _default = "2.14.0-alpha.12";
18
+ var _default = "2.14.0-alpha.13";
19
19
  exports.default = _default;
@@ -23,11 +23,13 @@ export default (navigator => {
23
23
 
24
24
  return (xdm, logger) => {
25
25
  try {
26
- return navigator.userAgentData.getHighEntropyValues(highEntropyUserAgentHints).then(hints => {
26
+ return navigator.userAgentData.getHighEntropyValues(highEntropyUserAgentHints.map(hint => hint[0])).then(hints => {
27
27
  const userAgentClientHints = {};
28
- highEntropyUserAgentHints.forEach(hint => {
29
- if (Object.prototype.hasOwnProperty.call(hints, hint)) {
30
- userAgentClientHints[hint] = hints[hint];
28
+ highEntropyUserAgentHints.forEach(([hintName, hintType]) => {
29
+ if (Object.prototype.hasOwnProperty.call(hints, hintName) &&
30
+ /* eslint-disable-next-line valid-typeof */
31
+ typeof hints[hintName] === hintType) {
32
+ userAgentClientHints[hintName] = hints[hintName];
31
33
  }
32
34
  });
33
35
  deepAssign(xdm, {
@@ -9,4 +9,4 @@ 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
- export default ["architecture", "bitness", "model", "platformVersion", "wow64"];
12
+ export default [["architecture", "string"], ["bitness", "string"], ["model", "string"], ["platformVersion", "string"], ["wow64", "boolean"]];
@@ -11,4 +11,4 @@ governing permissions and limitations under the License.
11
11
  */
12
12
  // The __VERSION__ keyword will be replace at alloy build time with the package.json version.
13
13
  // see babel-plugin-version
14
- export default "2.14.0-alpha.12";
14
+ export default "2.14.0-alpha.13";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/alloy",
3
- "version": "2.14.0-alpha.12",
3
+ "version": "2.14.0-alpha.13",
4
4
  "description": "Adobe Experience Platform Web SDK",
5
5
  "main": "libEs5/index.js",
6
6
  "module": "libEs6/index.js",
@@ -64,7 +64,7 @@
64
64
  "uuid": "^3.3.2"
65
65
  },
66
66
  "devDependencies": {
67
- "@adobe/alloy": "^2.14.0-alpha.11",
67
+ "@adobe/alloy": "^2.14.0-alpha.12",
68
68
  "@babel/cli": "^7.12.8",
69
69
  "@babel/core": "^7.2.2",
70
70
  "@babel/plugin-proposal-object-rest-spread": "^7.3.2",