be-hive 0.0.162 → 0.0.164

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 +3 -3
  2. package/prsObj.js +15 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "be-hive",
3
- "version": "0.0.162",
3
+ "version": "0.0.164",
4
4
  "keywords": [
5
5
  "web-components",
6
6
  "web-component",
@@ -28,9 +28,9 @@
28
28
  "update": "ncu -u && npm install"
29
29
  },
30
30
  "dependencies": {
31
- "be-enhanced": "0.0.90",
31
+ "be-enhanced": "0.0.91",
32
32
  "mount-observer": "0.0.25",
33
- "trans-render": "0.0.770"
33
+ "trans-render": "0.0.771"
34
34
  },
35
35
  "devDependencies": {
36
36
  "may-it-serve": "0.0.6"
package/prsObj.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export async function prsObj(prop, newValue, initialPropValues, attr) {
2
2
  const { instanceOf, mapsTo, valIfFalsy } = prop;
3
3
  let valToSet = newValue;
4
- if (valIfFalsy !== undefined && !newValue) {
4
+ if (valIfFalsy !== undefined && !newValue && mapsTo) {
5
5
  initialPropValues[mapsTo] = valIfFalsy;
6
6
  }
7
7
  else {
@@ -13,6 +13,8 @@ export async function prsObj(prop, newValue, initialPropValues, attr) {
13
13
  catch (e) {
14
14
  throw { err: 400, attr, newValue };
15
15
  }
16
+ if (mapsTo === undefined)
17
+ throw 400;
16
18
  if (mapsTo === '.') {
17
19
  Object.assign(initialPropValues, valToSet);
18
20
  }
@@ -24,9 +26,19 @@ export async function prsObj(prop, newValue, initialPropValues, attr) {
24
26
  initialPropValues[mapsTo] = valToSet;
25
27
  break;
26
28
  case 'Object$tring':
27
- const { Object$tring } = await import('trans-render/Object$tring.js');
28
- const parsedObj = new Object$tring(newValue);
29
+ case 'Object$entences':
29
30
  const { strValMapsTo, objValMapsTo, arrValMapsTo } = prop;
31
+ let parsedObj;
32
+ switch (instanceOf) {
33
+ case 'Object$tring':
34
+ const { Object$tring } = await import('trans-render/Object$tring.js');
35
+ parsedObj = new Object$tring(newValue);
36
+ break;
37
+ case 'Object$entences':
38
+ const { Object$entences } = await import('trans-render/Object$entences.js');
39
+ parsedObj = new Object$entences(newValue);
40
+ break;
41
+ }
30
42
  if (parsedObj.strVal && strValMapsTo !== undefined) {
31
43
  initialPropValues[strValMapsTo] = parsedObj.strVal;
32
44
  }