@legalplace/tagextractor 1.1.2 → 1.1.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.
package/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  import TagExtractor from './libs/Extractor';
2
+ import TagsType, { OptionTagType, VariableTagType } from './types/tags.type';
3
+ export { TagsType, OptionTagType, VariableTagType };
2
4
  export default TagExtractor;
@@ -38,13 +38,15 @@ var OvcConverter = (function () {
38
38
  currentOption.forEach(function (childId, index) {
39
39
  var sanitizedId = typeof childId === 'string' && childId.split('_').length > 0 ? childId.split('_')[0] : childId;
40
40
  if (!Object.prototype.hasOwnProperty.call(inputs.options, id)) {
41
- inputs.options[id] = new Array(occurences_1).fill(false);
41
+ var defaultValue = references.options[id].meta.type === 'static';
42
+ inputs.options[id] = new Array(occurences_1).fill(defaultValue);
42
43
  }
43
44
  if (typeof sanitizedId === 'string' && sanitizedId.trim().length === 0) {
44
45
  return;
45
46
  }
46
47
  if (!Object.prototype.hasOwnProperty.call(inputs.options, sanitizedId)) {
47
- inputs.options[sanitizedId] = new Array(occurences_1).fill(false);
48
+ var defaultValue = references.options[sanitizedId].meta.type === 'static';
49
+ inputs.options[sanitizedId] = new Array(occurences_1).fill(defaultValue);
48
50
  }
49
51
  inputs.options = __assign(__assign({}, inputs.options), _this.pushStaticChildren(inputs.options, sanitizedId, occurences_1, references));
50
52
  inputs.options[sanitizedId][index] = true;
@@ -125,7 +127,7 @@ var OvcConverter = (function () {
125
127
  });
126
128
  staticOptions.forEach(function (childId) {
127
129
  if (!Object.prototype.hasOwnProperty.call(result, childId)) {
128
- result[childId] = new Array(occurences).fill(false);
130
+ result[childId] = new Array(occurences).fill(true);
129
131
  }
130
132
  });
131
133
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legalplace/tagextractor",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "TagExtractor",
5
5
  "main": "dist/index.js",
6
6
  "repository": "https://git.legalplace.eu/legalplace/tagextractor",
package/src/index.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  import TagExtractor from './libs/Extractor'
2
2
 
3
+ import TagsType, { OptionTagType, VariableTagType } from './types/tags.type'
4
+
5
+ export { TagsType, OptionTagType, VariableTagType }
3
6
  export default TagExtractor
@@ -29,7 +29,8 @@ class OvcConverter {
29
29
 
30
30
  // Making sure the input exist
31
31
  if (!Object.prototype.hasOwnProperty.call(inputs.options, id)) {
32
- inputs.options[id] = new Array(occurences).fill(false)
32
+ const defaultValue = references.options[id].meta.type === 'static'
33
+ inputs.options[id] = new Array(occurences).fill(defaultValue)
33
34
  }
34
35
 
35
36
  // Making sure the childId is not empty
@@ -39,7 +40,8 @@ class OvcConverter {
39
40
 
40
41
  // Creating input if it doesn't exist
41
42
  if (!Object.prototype.hasOwnProperty.call(inputs.options, sanitizedId)) {
42
- inputs.options[sanitizedId] = new Array(occurences).fill(false)
43
+ const defaultValue = references.options[sanitizedId].meta.type === 'static'
44
+ inputs.options[sanitizedId] = new Array(occurences).fill(defaultValue)
43
45
  }
44
46
 
45
47
  // Adding static childrens
@@ -142,7 +144,7 @@ class OvcConverter {
142
144
  staticOptions.forEach(childId => {
143
145
  // Creating input if it doesn't exist
144
146
  if (!Object.prototype.hasOwnProperty.call(result, childId)) {
145
- result[childId] = new Array(occurences).fill(false)
147
+ result[childId] = new Array(occurences).fill(true)
146
148
  }
147
149
  })
148
150