sfc-utils 1.4.158 → 1.4.159

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/personalize.js +12 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfc-utils",
3
- "version": "1.4.158",
3
+ "version": "1.4.159",
4
4
  "author": "ewagstaff <evanjwagstaff@gmail.com>",
5
5
  "dependencies": {
6
6
  "archieml": "^0.4.2",
package/personalize.js CHANGED
@@ -9,17 +9,24 @@ const getProfileProperty = (property) => {
9
9
  const profile = window.blueConicClient.profile.getProfile();
10
10
  // Check if property is an array
11
11
  let properties = [];
12
+ let isArray = false;
12
13
  if (Array.isArray(property)) {
13
14
  properties = property;
15
+ isArray = true;
14
16
  } else {
15
17
  properties = [property];
16
18
  }
17
19
  profile.loadValues(properties, this, function () {
18
- var value = profile.getValue(property);
19
- // Return a valid result or null
20
- value = value || null;
21
- console.log("getProfileProperty VAL", value);
22
- innerResolve({ existingValue: value, profile: profile });
20
+ if (isArray) {
21
+ console.log("getProfileProperty ARRAY VAL", properties);
22
+ innerResolve({ properties: properties, profile: profile });
23
+ } else {
24
+ var value = profile.getValue(property);
25
+ // Return a valid result or null
26
+ value = value || null;
27
+ console.log("getProfileProperty VAL", value);
28
+ innerResolve({ existingValue: value, profile: profile });
29
+ }
23
30
  });
24
31
  } else {
25
32
  attempts++;