data-restructor 3.3.3 → 3.4.0

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 (54) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +2 -2
  2. package/.github/workflows/codeql-analysis.yml +4 -4
  3. package/.github/workflows/continuous-integration.yaml +84 -0
  4. package/CHANGELOG.md +103 -75
  5. package/CONTRIBUTING.md +51 -43
  6. package/Commands.md +15 -15
  7. package/README.md +188 -137
  8. package/SECURITY.md +15 -0
  9. package/coverage/coverage-summary.json +4 -4
  10. package/coverage/datarestructor.js.html +446 -320
  11. package/coverage/describedfield.js.html +47 -47
  12. package/coverage/index.html +19 -19
  13. package/coverage/templateResolver.js.html +26 -26
  14. package/devdist/datarestructor-global-all.js +65 -23
  15. package/devdist/datarestructor-ie-global-all.js +65 -23
  16. package/devdist/datarestructor-ie.js +1479 -1616
  17. package/devdist/datarestructor.js +1439 -1559
  18. package/devdist/describedfield-ie.js +259 -279
  19. package/devdist/describedfield.js +257 -277
  20. package/devdist/templateResolver-ie.js +220 -252
  21. package/devdist/templateResolver.js +196 -227
  22. package/dist/datarestructor-global-all-min.js +1 -1
  23. package/dist/datarestructor-ie-global-all-min.js +1 -1
  24. package/dist/datarestructor-ie.js +1 -1
  25. package/dist/datarestructor-ie.js.map +1 -1
  26. package/dist/datarestructor.js +1 -1
  27. package/dist/datarestructor.js.map +1 -1
  28. package/dist/describedfield-ie.js +1 -1
  29. package/dist/describedfield-ie.js.map +1 -1
  30. package/dist/describedfield.js +1 -1
  31. package/dist/describedfield.js.map +1 -1
  32. package/dist/templateResolver-ie.js +1 -1
  33. package/dist/templateResolver-ie.js.map +1 -1
  34. package/dist/templateResolver.js +1 -1
  35. package/dist/templateResolver.js.map +1 -1
  36. package/docs/datarestructor.js.html +66 -24
  37. package/docs/describedfield.js.html +1 -1
  38. package/docs/index.html +49 -44
  39. package/docs/module-datarestructor.DescribedEntryCreator.html +1 -1
  40. package/docs/module-datarestructor.PropertyStructureDescriptionBuilder.html +1 -1
  41. package/docs/module-datarestructor.Restructor.html +3 -3
  42. package/docs/module-datarestructor.Transform.html +7 -30
  43. package/docs/module-datarestructor.html +100 -3
  44. package/docs/module-described_field.DescribedDataFieldBuilder.html +1 -1
  45. package/docs/module-described_field.DescribedDataFieldGroup.html +1 -1
  46. package/docs/module-described_field.html +1 -1
  47. package/docs/module-template_resolver.Resolver.html +1 -1
  48. package/docs/module-template_resolver.html +1 -1
  49. package/docs/templateResolver.js.html +1 -1
  50. package/package.json +16 -14
  51. package/renovate.json +20 -0
  52. package/src/js/datarestructor.js +65 -23
  53. package/test/js/DataRestructorUseCaseTest.js +36 -0
  54. package/.github/workflows/action.yaml +0 -44
@@ -6,7 +6,7 @@
6
6
  // anything defined in a previous bundle is accessed via the
7
7
  // orig method which is the require for previous bundles
8
8
 
9
- (function(modules, entry, mainEntry, parcelRequireName, globalName) {
9
+ (function (modules, entry, mainEntry, parcelRequireName, globalName) {
10
10
  /* eslint-disable no-undef */
11
11
  var globalObject =
12
12
  typeof globalThis !== 'undefined'
@@ -80,11 +80,13 @@
80
80
  return cache[name].exports;
81
81
 
82
82
  function localRequire(x) {
83
- return newRequire(localRequire.resolve(x));
83
+ var res = localRequire.resolve(x);
84
+ return res === false ? {} : newRequire(res);
84
85
  }
85
86
 
86
87
  function resolve(x) {
87
- return modules[name][1][x] || x;
88
+ var id = modules[name][1][x];
89
+ return id != null ? id : x;
88
90
  }
89
91
  }
90
92
 
@@ -99,9 +101,9 @@
99
101
  newRequire.modules = modules;
100
102
  newRequire.cache = cache;
101
103
  newRequire.parent = previousRequire;
102
- newRequire.register = function(id, exports) {
104
+ newRequire.register = function (id, exports) {
103
105
  modules[id] = [
104
- function(require, module) {
106
+ function (require, module) {
105
107
  module.exports = exports;
106
108
  },
107
109
  {},
@@ -109,7 +111,7 @@
109
111
  };
110
112
 
111
113
  Object.defineProperty(newRequire, 'root', {
112
- get: function() {
114
+ get: function () {
113
115
  return globalObject[parcelRequireName];
114
116
  },
115
117
  });
@@ -131,7 +133,7 @@
131
133
 
132
134
  // RequireJS
133
135
  } else if (typeof define === 'function' && define.amd) {
134
- define(function() {
136
+ define(function () {
135
137
  return mainExports;
136
138
  });
137
139
 
@@ -140,287 +142,265 @@
140
142
  this[globalName] = mainExports;
141
143
  }
142
144
  }
143
- })({"4X3T9":[function(require,module,exports) {
145
+ })({"cleYG":[function(require,module,exports) {
144
146
  /**
145
- * @file Describes a data field of the restructured data.
146
- * @version {@link https://github.com/JohT/data-restructor-js/releases/latest latest version}
147
- * @author JohT
148
- * @version ${project.version}
149
- */
150
- "use strict";
151
- var module = describedFieldInternalCreateIfNotExists(module);
152
- // Fallback for vanilla js without modules
147
+ * @file Describes a data field of the restructured data.
148
+ * @version {@link https://github.com/JohT/data-restructor-js/releases/latest latest version}
149
+ * @author JohT
150
+ * @version ${project.version}
151
+ */ "use strict";
152
+ var module = describedFieldInternalCreateIfNotExists(module); // Fallback for vanilla js without modules
153
153
  function describedFieldInternalCreateIfNotExists(objectToCheck) {
154
- return objectToCheck || ({});
154
+ return objectToCheck || {
155
+ };
155
156
  }
156
157
  /**
157
- * Describes a data field of the restructured data.
158
- * @module described_field
159
- */
160
- var described_field = module.exports = {};
161
- // Export module for npm...
158
+ * Describes a data field of the restructured data.
159
+ * @module described_field
160
+ */ var described_field = module.exports = {
161
+ }; // Export module for npm...
162
162
  described_field.internalCreateIfNotExists = describedFieldInternalCreateIfNotExists;
163
163
  /**
164
- * Describes a field of the restructured data.
165
- * Dynamically added properties represent custom named groups containing DescribedDataField-Arrays.
166
- *
167
- * @typedef {Object} module:described_field.DescribedDataField
168
- * @property {string} [category=""] - name of the category. Could contain a short domain name like "product" or "vendor".
169
- * @property {string} [type=""] - type of the data element. Examples: "summary" for e.g. a list overview. "detail" e.g. when a summary is selected. "filter" e.g. for field/value pair results that can be selected as data filters.
170
- * @property {string} [abbreviation=""] - one optional character, a symbol character or a short abbreviation of the category
171
- * @property {string} [image=""] - one optional path to an image resource
172
- * @property {string} index - array of numbers containing the splitted index. Example: "responses[2].hits.hits[4]._source.name" will have an index of [2,4]
173
- * @property {string[]} groupNames - array of names of all dynamically added properties representing groups
174
- * @property {string} displayName - display name of the field
175
- * @property {string} fieldName - field name
176
- * @property {{*}} value - content of the field
177
- * @property {module:described_field.DescribedDataField[]} [couldBeAnyCustomGroupName] any number of groups attached to the field each containing multiple fields
178
- */
179
- described_field.DescribedDataFieldBuilder = (function () {
180
- /**
181
- * Builds a {@link module:described_field.DescribedDataField}.
182
- * DescribedDataField is the main element of the restructured data and therefore considered "public".
183
- * @constructs DescribedDataFieldBuilder
184
- * @alias module:described_field.DescribedDataFieldBuilder
185
- */
186
- function DescribedDataFieldBuilder() {
187
- /**
188
- * @type {module:described_field.DescribedDataField}
189
- */
190
- this.describedField = {
191
- category: "",
192
- type: "",
193
- abbreviation: "",
194
- image: "",
195
- index: [],
196
- groupNames: [],
197
- displayName: "",
198
- fieldName: "",
199
- value: ""
200
- };
201
- /**
202
- * Takes over all values of the template {@link module:described_field.DescribedDataField}.
203
- * @function
204
- * @param {module:described_field.DescribedDataField} template
205
- * @returns {DescribedDataFieldBuilder}
206
- * @example fromDescribedDataField(sourceField)
207
- */
208
- this.fromDescribedDataField = function (template) {
209
- this.category(template.category);
210
- this.type(template.type);
211
- this.abbreviation(template.abbreviation);
212
- this.image(template.image);
213
- this.index(template.index);
214
- this.groupNames(template.groupNames);
215
- this.displayName(template.displayName);
216
- this.fieldName(template.fieldName);
217
- this.value(template.value);
218
- return this;
219
- };
220
- /**
221
- * Sets the category.
222
- *
223
- * Contains a short domain nam, for example:
224
- * - "product" for products
225
- * - "vendor" for vendors
226
- *
227
- * @function
228
- * @param {String} [value=""]
229
- * @returns {DescribedDataFieldBuilder}
230
- * @example category("Product")
231
- */
232
- this.category = function (value) {
233
- this.describedField.category = withDefaultString(value, "");
234
- return this;
235
- };
236
- /**
237
- * Sets the type.
238
- *
239
- * Contains the type of the entry, for example:
240
- * - "summary" for e.g. a list overview.
241
- * - "detail" e.g. when a summary is selected.
242
- * - "filter" e.g. for field/value pair results that can be selected as search parameters.
243
- *
244
- * @function
245
- * @param {String} [value=""]
246
- * @returns {DescribedDataFieldBuilder}
247
- * @example type("summary")
248
- */
249
- this.type = function (value) {
250
- this.describedField.type = withDefaultString(value, "");
251
- return this;
252
- };
253
- /**
254
- * Sets the optional abbreviation.
255
- *
256
- * Contains a symbol character or a very short abbreviation of the category.
257
- * - "P" for products
258
- * - "V" for vendors
259
- *
260
- * @function
261
- * @param {String} [value=""]
262
- * @returns {DescribedDataFieldBuilder}
263
- * @example abbreviation("P")
264
- */
265
- this.abbreviation = function (value) {
266
- this.describedField.abbreviation = withDefaultString(value, "");
267
- return this;
268
- };
269
- /**
270
- * Sets the optional path to an image resource.
271
- *
272
- * @function
273
- * @param {String} [value=""]
274
- * @returns {DescribedDataFieldBuilder}
275
- * @example image("img/product.png")
276
- */
277
- this.image = function (value) {
278
- this.describedField.image = withDefaultString(value, "");
279
- return this;
280
- };
281
- /**
282
- * Sets the index as an array of numbers containing the splitted array indexes of the source field.
283
- * Example: "responses[2].hits.hits[4]._source.name" will have an index of [2,4].
284
- *
285
- * @function
286
- * @param {number[]} [value=[]]
287
- * @returns {DescribedDataFieldBuilder}
288
- * @example index([2,4])
289
- */
290
- this.index = function (value) {
291
- this.describedField.index = withDefaultArray(value, []);
292
- return this;
293
- };
294
- /**
295
- * Sets the group names as an array of strings containing the names of the dynamically added properties,
296
- * that contain an array of {@link module:described_field.DescribedDataField}-Objects.
297
- *
298
- * @function
299
- * @param {string[]} [value=[]]
300
- * @returns {DescribedDataFieldBuilder}
301
- * @example groupNames(["summaries","details","options"])
302
- */
303
- this.groupNames = function (value) {
304
- this.describedField.groupNames = withDefaultArray(value, []);
305
- return this;
306
- };
307
- /**
308
- * Sets the display name.
309
- *
310
- * @function
311
- * @param {String} [value=""]
312
- * @returns {DescribedDataFieldBuilder}
313
- * @example displayName("Color")
314
- */
315
- this.displayName = function (value) {
316
- this.describedField.displayName = withDefaultString(value, "");
317
- return this;
318
- };
319
- /**
320
- * Sets the (technical) field name.
321
- *
322
- * @function
323
- * @param {String} [value=""]
324
- * @returns {DescribedDataFieldBuilder}
325
- * @example fieldName("color")
326
- */
327
- this.fieldName = function (value) {
328
- this.describedField.fieldName = withDefaultString(value, "");
329
- return this;
330
- };
164
+ * Describes a field of the restructured data.
165
+ * Dynamically added properties represent custom named groups containing DescribedDataField-Arrays.
166
+ *
167
+ * @typedef {Object} module:described_field.DescribedDataField
168
+ * @property {string} [category=""] - name of the category. Could contain a short domain name like "product" or "vendor".
169
+ * @property {string} [type=""] - type of the data element. Examples: "summary" for e.g. a list overview. "detail" e.g. when a summary is selected. "filter" e.g. for field/value pair results that can be selected as data filters.
170
+ * @property {string} [abbreviation=""] - one optional character, a symbol character or a short abbreviation of the category
171
+ * @property {string} [image=""] - one optional path to an image resource
172
+ * @property {string} index - array of numbers containing the splitted index. Example: "responses[2].hits.hits[4]._source.name" will have an index of [2,4]
173
+ * @property {string[]} groupNames - array of names of all dynamically added properties representing groups
174
+ * @property {string} displayName - display name of the field
175
+ * @property {string} fieldName - field name
176
+ * @property {{*}} value - content of the field
177
+ * @property {module:described_field.DescribedDataField[]} [couldBeAnyCustomGroupName] any number of groups attached to the field each containing multiple fields
178
+ */ described_field.DescribedDataFieldBuilder = (function() {
331
179
  /**
332
- * Sets the value/content of the field.
333
- *
334
- * @function
335
- * @param {*} value
336
- * @returns {DescribedDataFieldBuilder}
337
- * @example value("darkblue")
338
- */
339
- this.value = function (value) {
340
- this.describedField.value = value;
341
- return this;
342
- };
343
- /**
344
- * Finalizes the settings and builds the {@link module:described_field.DescribedDataField}.
345
- * @function
346
- * @returns {module:described_field.DescribedDataField}
347
- */
348
- this.build = function () {
349
- return this.describedField;
350
- };
351
- }
352
- function isSpecifiedString(value) {
353
- return typeof value === "string" && value !== null && value !== "";
354
- }
355
- function withDefaultString(value, defaultValue) {
356
- return isSpecifiedString(value) ? value : defaultValue;
357
- }
358
- function withDefaultArray(value, defaultValue) {
359
- return value === undefined || value === null ? defaultValue : value;
360
- }
361
- return DescribedDataFieldBuilder;
180
+ * Builds a {@link module:described_field.DescribedDataField}.
181
+ * DescribedDataField is the main element of the restructured data and therefore considered "public".
182
+ * @constructs DescribedDataFieldBuilder
183
+ * @alias module:described_field.DescribedDataFieldBuilder
184
+ */ function DescribedDataFieldBuilder() {
185
+ /**
186
+ * @type {module:described_field.DescribedDataField}
187
+ */ this.describedField = {
188
+ category: "",
189
+ type: "",
190
+ abbreviation: "",
191
+ image: "",
192
+ index: [],
193
+ groupNames: [],
194
+ displayName: "",
195
+ fieldName: "",
196
+ value: ""
197
+ };
198
+ /**
199
+ * Takes over all values of the template {@link module:described_field.DescribedDataField}.
200
+ * @function
201
+ * @param {module:described_field.DescribedDataField} template
202
+ * @returns {DescribedDataFieldBuilder}
203
+ * @example fromDescribedDataField(sourceField)
204
+ */ this.fromDescribedDataField = function(template) {
205
+ this.category(template.category);
206
+ this.type(template.type);
207
+ this.abbreviation(template.abbreviation);
208
+ this.image(template.image);
209
+ this.index(template.index);
210
+ this.groupNames(template.groupNames);
211
+ this.displayName(template.displayName);
212
+ this.fieldName(template.fieldName);
213
+ this.value(template.value);
214
+ return this;
215
+ };
216
+ /**
217
+ * Sets the category.
218
+ *
219
+ * Contains a short domain nam, for example:
220
+ * - "product" for products
221
+ * - "vendor" for vendors
222
+ *
223
+ * @function
224
+ * @param {String} [value=""]
225
+ * @returns {DescribedDataFieldBuilder}
226
+ * @example category("Product")
227
+ */ this.category = function(value) {
228
+ this.describedField.category = withDefaultString(value, "");
229
+ return this;
230
+ };
231
+ /**
232
+ * Sets the type.
233
+ *
234
+ * Contains the type of the entry, for example:
235
+ * - "summary" for e.g. a list overview.
236
+ * - "detail" e.g. when a summary is selected.
237
+ * - "filter" e.g. for field/value pair results that can be selected as search parameters.
238
+ *
239
+ * @function
240
+ * @param {String} [value=""]
241
+ * @returns {DescribedDataFieldBuilder}
242
+ * @example type("summary")
243
+ */ this.type = function(value) {
244
+ this.describedField.type = withDefaultString(value, "");
245
+ return this;
246
+ };
247
+ /**
248
+ * Sets the optional abbreviation.
249
+ *
250
+ * Contains a symbol character or a very short abbreviation of the category.
251
+ * - "P" for products
252
+ * - "V" for vendors
253
+ *
254
+ * @function
255
+ * @param {String} [value=""]
256
+ * @returns {DescribedDataFieldBuilder}
257
+ * @example abbreviation("P")
258
+ */ this.abbreviation = function(value) {
259
+ this.describedField.abbreviation = withDefaultString(value, "");
260
+ return this;
261
+ };
262
+ /**
263
+ * Sets the optional path to an image resource.
264
+ *
265
+ * @function
266
+ * @param {String} [value=""]
267
+ * @returns {DescribedDataFieldBuilder}
268
+ * @example image("img/product.png")
269
+ */ this.image = function(value) {
270
+ this.describedField.image = withDefaultString(value, "");
271
+ return this;
272
+ };
273
+ /**
274
+ * Sets the index as an array of numbers containing the splitted array indexes of the source field.
275
+ * Example: "responses[2].hits.hits[4]._source.name" will have an index of [2,4].
276
+ *
277
+ * @function
278
+ * @param {number[]} [value=[]]
279
+ * @returns {DescribedDataFieldBuilder}
280
+ * @example index([2,4])
281
+ */ this.index = function(value) {
282
+ this.describedField.index = withDefaultArray(value, []);
283
+ return this;
284
+ };
285
+ /**
286
+ * Sets the group names as an array of strings containing the names of the dynamically added properties,
287
+ * that contain an array of {@link module:described_field.DescribedDataField}-Objects.
288
+ *
289
+ * @function
290
+ * @param {string[]} [value=[]]
291
+ * @returns {DescribedDataFieldBuilder}
292
+ * @example groupNames(["summaries","details","options"])
293
+ */ this.groupNames = function(value) {
294
+ this.describedField.groupNames = withDefaultArray(value, []);
295
+ return this;
296
+ };
297
+ /**
298
+ * Sets the display name.
299
+ *
300
+ * @function
301
+ * @param {String} [value=""]
302
+ * @returns {DescribedDataFieldBuilder}
303
+ * @example displayName("Color")
304
+ */ this.displayName = function(value) {
305
+ this.describedField.displayName = withDefaultString(value, "");
306
+ return this;
307
+ };
308
+ /**
309
+ * Sets the (technical) field name.
310
+ *
311
+ * @function
312
+ * @param {String} [value=""]
313
+ * @returns {DescribedDataFieldBuilder}
314
+ * @example fieldName("color")
315
+ */ this.fieldName = function(value) {
316
+ this.describedField.fieldName = withDefaultString(value, "");
317
+ return this;
318
+ };
319
+ /**
320
+ * Sets the value/content of the field.
321
+ *
322
+ * @function
323
+ * @param {*} value
324
+ * @returns {DescribedDataFieldBuilder}
325
+ * @example value("darkblue")
326
+ */ this.value = function(value) {
327
+ this.describedField.value = value;
328
+ return this;
329
+ };
330
+ /**
331
+ * Finalizes the settings and builds the {@link module:described_field.DescribedDataField}.
332
+ * @function
333
+ * @returns {module:described_field.DescribedDataField}
334
+ */ this.build = function() {
335
+ return this.describedField;
336
+ };
337
+ }
338
+ function isSpecifiedString(value) {
339
+ return typeof value === "string" && value !== null && value !== "";
340
+ }
341
+ function withDefaultString(value, defaultValue) {
342
+ return isSpecifiedString(value) ? value : defaultValue;
343
+ }
344
+ function withDefaultArray(value, defaultValue) {
345
+ return value === undefined || value === null ? defaultValue : value;
346
+ }
347
+ return DescribedDataFieldBuilder;
362
348
  })();
363
349
  /**
364
- * Creates a new described data field with all properties of the original one except for dynamically added groups.
365
- * @param {module:described_field.DescribedDataField} describedDataField
366
- * @returns {module:described_field.DescribedDataField}
367
- * @memberof module:described_field
368
- */
369
- described_field.copyWithoutGroups = function (describedDataField) {
370
- return new described_field.DescribedDataFieldBuilder().fromDescribedDataField(describedDataField).groupNames([]).build();
350
+ * Creates a new described data field with all properties of the original one except for dynamically added groups.
351
+ * @param {module:described_field.DescribedDataField} describedDataField
352
+ * @returns {module:described_field.DescribedDataField}
353
+ * @memberof module:described_field
354
+ */ described_field.copyWithoutGroups = function(describedDataField) {
355
+ return new described_field.DescribedDataFieldBuilder().fromDescribedDataField(describedDataField).groupNames([]).build();
371
356
  };
372
- described_field.DescribedDataFieldGroup = (function () {
373
- /**
374
- * Adds groups to {@link module:described_field.DescribedDataField}s. These groups are dynamically added properties
375
- * that contain an array of sub fields of the same type {@link module:described_field.DescribedDataField}s.
376
- *
377
- * @param {module:described_field.DescribedDataField} dataField
378
- * @constructs DescribedDataFieldGroup
379
- * @alias module:described_field.DescribedDataFieldGroup
380
- * @example new described_field.DescribedDataFieldGroup(field).addGroupEntry("details", detailField);
381
- */
382
- function DescribedDataFieldGroup(dataField) {
383
- this.dataField = dataField;
384
- /**
385
- * Adds an entry to the given group. If the group does not exist, it will be created.
386
- * @function
387
- * @param {String} groupName name of the group to which the entry will be added
388
- * @param {module:described_field.DescribedDataField} describedField sub field that is added to the group
389
- * @returns {DescribedDataFieldGroup}
390
- */
391
- this.addGroupEntry = function (groupName, describedField) {
392
- this.addGroupEntries(groupName, [describedField]);
393
- return this;
394
- };
357
+ described_field.DescribedDataFieldGroup = (function() {
395
358
  /**
396
- * Adds entries to the given group. If the group does not exist, it will be created.
397
- * @function
398
- * @param {String} groupName name of the group to which the entries will be added
399
- * @param {module:described_field.DescribedDataField[]} describedFields sub fields that are added to the group
400
- * @returns {DescribedDataFieldGroup}
401
- */
402
- this.addGroupEntries = function (groupName, describedFields) {
403
- if (!groupName || groupName.length === 0) {
404
- return this;
405
- }
406
- if (!describedFields || describedFields.length === 0) {
407
- return this;
408
- }
409
- if (this.dataField[groupName] === undefined) {
410
- this.dataField.groupNames.push(groupName);
411
- this.dataField[groupName] = [];
412
- }
413
- var index;
414
- var describedField;
415
- for (index = 0; index < describedFields.length; index += 1) {
416
- describedField = describedFields[index];
417
- this.dataField[groupName].push(describedField);
418
- }
419
- return this;
420
- };
421
- }
422
- return DescribedDataFieldGroup;
359
+ * Adds groups to {@link module:described_field.DescribedDataField}s. These groups are dynamically added properties
360
+ * that contain an array of sub fields of the same type {@link module:described_field.DescribedDataField}s.
361
+ *
362
+ * @param {module:described_field.DescribedDataField} dataField
363
+ * @constructs DescribedDataFieldGroup
364
+ * @alias module:described_field.DescribedDataFieldGroup
365
+ * @example new described_field.DescribedDataFieldGroup(field).addGroupEntry("details", detailField);
366
+ */ function DescribedDataFieldGroup(dataField) {
367
+ this.dataField = dataField;
368
+ /**
369
+ * Adds an entry to the given group. If the group does not exist, it will be created.
370
+ * @function
371
+ * @param {String} groupName name of the group to which the entry will be added
372
+ * @param {module:described_field.DescribedDataField} describedField sub field that is added to the group
373
+ * @returns {DescribedDataFieldGroup}
374
+ */ this.addGroupEntry = function(groupName, describedField) {
375
+ this.addGroupEntries(groupName, [
376
+ describedField
377
+ ]);
378
+ return this;
379
+ };
380
+ /**
381
+ * Adds entries to the given group. If the group does not exist, it will be created.
382
+ * @function
383
+ * @param {String} groupName name of the group to which the entries will be added
384
+ * @param {module:described_field.DescribedDataField[]} describedFields sub fields that are added to the group
385
+ * @returns {DescribedDataFieldGroup}
386
+ */ this.addGroupEntries = function(groupName, describedFields) {
387
+ if (!groupName || groupName.length === 0) return this;
388
+ if (!describedFields || describedFields.length === 0) return this;
389
+ if (this.dataField[groupName] === undefined) {
390
+ this.dataField.groupNames.push(groupName);
391
+ this.dataField[groupName] = [];
392
+ }
393
+ var index;
394
+ var describedField;
395
+ for(index = 0; index < describedFields.length; index += 1){
396
+ describedField = describedFields[index];
397
+ this.dataField[groupName].push(describedField);
398
+ }
399
+ return this;
400
+ };
401
+ }
402
+ return DescribedDataFieldGroup;
423
403
  })();
424
404
 
425
- },{}]},["4X3T9"], "4X3T9", "parcelRequire9661")
405
+ },{}]},["cleYG"], "cleYG", "parcelRequirec1f2")
426
406