data-restructor 3.4.3 → 3.4.5

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 (45) hide show
  1. package/.auto-changelog-template.hbs +1 -1
  2. package/.github/workflows/codeql-analysis.yml +6 -6
  3. package/.github/workflows/continuous-integration.yaml +11 -11
  4. package/.nvmrc +1 -0
  5. package/CHANGELOG.md +71 -1
  6. package/CONTRIBUTING.md +3 -3
  7. package/README.md +25 -25
  8. package/coverage/datarestructor.js.html +133 -133
  9. package/coverage/describedfield.js.html +45 -45
  10. package/coverage/index.html +1 -1
  11. package/coverage/templateResolver.js.html +26 -26
  12. package/devdist/datarestructor-ie.js +86 -21
  13. package/devdist/datarestructor.js +77 -12
  14. package/devdist/describedfield-ie.js +75 -10
  15. package/devdist/describedfield.js +74 -9
  16. package/devdist/templateResolver-ie.js +79 -14
  17. package/devdist/templateResolver.js +75 -10
  18. package/dist/datarestructor-ie.js +1 -1
  19. package/dist/datarestructor-ie.js.map +1 -1
  20. package/dist/datarestructor.js +1 -1
  21. package/dist/datarestructor.js.map +1 -1
  22. package/dist/describedfield-ie.js +1 -1
  23. package/dist/describedfield-ie.js.map +1 -1
  24. package/dist/describedfield.js +1 -1
  25. package/dist/describedfield.js.map +1 -1
  26. package/dist/templateResolver-ie.js +1 -1
  27. package/dist/templateResolver-ie.js.map +1 -1
  28. package/dist/templateResolver.js +1 -1
  29. package/dist/templateResolver.js.map +1 -1
  30. package/docs/datarestructor.js.html +1 -1
  31. package/docs/describedfield.js.html +1 -1
  32. package/docs/index.html +26 -26
  33. package/docs/module-datarestructor.DescribedEntryCreator.html +1 -1
  34. package/docs/module-datarestructor.PropertyStructureDescriptionBuilder.html +1 -1
  35. package/docs/module-datarestructor.Restructor.html +1 -1
  36. package/docs/module-datarestructor.Transform.html +1 -1
  37. package/docs/module-datarestructor.html +1 -1
  38. package/docs/module-described_field.DescribedDataFieldBuilder.html +1 -1
  39. package/docs/module-described_field.DescribedDataFieldGroup.html +1 -1
  40. package/docs/module-described_field.html +1 -1
  41. package/docs/module-template_resolver.Resolver.html +1 -1
  42. package/docs/module-template_resolver.html +1 -1
  43. package/docs/templateResolver.js.html +1 -1
  44. package/merger-config.json +2 -2
  45. package/package.json +12 -12
@@ -1,2 +1,2 @@
1
- var i=globalThis,e={},t={},r=i.parcelRequirec1f2;null==r&&((r=function(i){if(i in e)return e[i].exports;if(i in t){var r=t[i];delete t[i];var s={id:i,exports:{}};return e[i]=s,r.call(s.exports,s,s.exports),s.exports}var n=Error("Cannot find module '"+i+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(i,e){t[i]=e},i.parcelRequirec1f2=r),(0,r.register)("aJuQy",function(i,e){var t=r(t);function r(i){return i||{}}var s=t.exports={};s.internalCreateIfNotExists=r,s.DescribedDataFieldBuilder=function(){function i(i,e){return"string"==typeof i&&null!==i&&""!==i?i:e}return function(){this.describedField={category:"",type:"",abbreviation:"",image:"",index:[],groupNames:[],displayName:"",fieldName:"",value:""},this.fromDescribedDataField=function(i){return this.category(i.category),this.type(i.type),this.abbreviation(i.abbreviation),this.image(i.image),this.index(i.index),this.groupNames(i.groupNames),this.displayName(i.displayName),this.fieldName(i.fieldName),this.value(i.value),this},this.category=function(e){return this.describedField.category=i(e,""),this},this.type=function(e){return this.describedField.type=i(e,""),this},this.abbreviation=function(e){return this.describedField.abbreviation=i(e,""),this},this.image=function(e){return this.describedField.image=i(e,""),this},this.index=function(i){var e;return this.describedField.index=(e=[],null==i?e:i),this},this.groupNames=function(i){var e;return this.describedField.groupNames=(e=[],null==i?e:i),this},this.displayName=function(e){return this.describedField.displayName=i(e,""),this},this.fieldName=function(e){return this.describedField.fieldName=i(e,""),this},this.value=function(i){return this.describedField.value=i,this},this.build=function(){return this.describedField}}}(),s.copyWithoutGroups=function(i){return new s.DescribedDataFieldBuilder().fromDescribedDataField(i).groupNames([]).build()},s.DescribedDataFieldGroup=function(i){this.dataField=i,this.addGroupEntry=function(i,e){return this.addGroupEntries(i,[e]),this},this.addGroupEntries=function(i,e){var t,r;if(!i||0===i.length||!e||0===e.length)return this;for(void 0===this.dataField[i]&&(this.dataField.groupNames.push(i),this.dataField[i]=[]),t=0;t<e.length;t+=1)r=e[t],this.dataField[i].push(r);return this}}});var s=r("aJuQy");module.exports={described_field:s};
1
+ var $parcel$global=globalThis,$parcel$modules={},$parcel$inits={},parcelRequire=$parcel$global.parcelRequirec1f2;null==parcelRequire&&((parcelRequire=function(e){if(e in $parcel$modules)return $parcel$modules[e].exports;if(e in $parcel$inits){var i=$parcel$inits[e];delete $parcel$inits[e];var t={id:e,exports:{}};return $parcel$modules[e]=t,i.call(t.exports,t,t.exports),t.exports}var r=Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(e,i){$parcel$inits[e]=i},$parcel$global.parcelRequirec1f2=parcelRequire);var parcelRegister=parcelRequire.register;parcelRegister("aJuQy",function(e,i){"use strict";var t=r(t);function r(e){return e||{}}var a=t.exports={};a.internalCreateIfNotExists=r,a.DescribedDataFieldBuilder=function(){function e(e,i){return"string"==typeof e&&null!==e&&""!==e?e:i}return function(){this.describedField={category:"",type:"",abbreviation:"",image:"",index:[],groupNames:[],displayName:"",fieldName:"",value:""},this.fromDescribedDataField=function(e){return this.category(e.category),this.type(e.type),this.abbreviation(e.abbreviation),this.image(e.image),this.index(e.index),this.groupNames(e.groupNames),this.displayName(e.displayName),this.fieldName(e.fieldName),this.value(e.value),this},this.category=function(i){return this.describedField.category=e(i,""),this},this.type=function(i){return this.describedField.type=e(i,""),this},this.abbreviation=function(i){return this.describedField.abbreviation=e(i,""),this},this.image=function(i){return this.describedField.image=e(i,""),this},this.index=function(e){var i,t;return this.describedField.index=(t=[],null==(i=e)?t:i),this},this.groupNames=function(e){var i,t;return this.describedField.groupNames=(t=[],null==(i=e)?t:i),this},this.displayName=function(i){return this.describedField.displayName=e(i,""),this},this.fieldName=function(i){return this.describedField.fieldName=e(i,""),this},this.value=function(e){return this.describedField.value=e,this},this.build=function(){return this.describedField}}}(),a.copyWithoutGroups=function(e){return new a.DescribedDataFieldBuilder().fromDescribedDataField(e).groupNames([]).build()},a.DescribedDataFieldGroup=function(e){this.dataField=e,this.addGroupEntry=function(e,i){return this.addGroupEntries(e,[i]),this},this.addGroupEntries=function(e,i){var t,r;if(!e||0===e.length||!i||0===i.length)return this;for(void 0===this.dataField[e]&&(this.dataField.groupNames.push(e),this.dataField[e]=[]),t=0;t<i.length;t+=1)r=i[t],this.dataField[e].push(r);return this}}});"use strict";var $aJuQy=parcelRequire("aJuQy");module.exports={described_field:$aJuQy};
2
2
  //# sourceMappingURL=describedfield-ie.js.map
@@ -1 +1 @@
1
- {"mappings":"A,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,A,C,E,E,Q,A,E,Q,S,C,C,C,ECOA,IAAI,EAAS,EAAwC,GAErD,SAAS,EAAwC,CAAa,EAC5D,OAAO,GAAiB,CAAC,CAC3B,CAMA,IAAI,EAAmB,EAAO,OAAO,CAAG,CAAC,CACzC,CAAA,EAAgB,yBAAyB,CAAG,EAmB5C,EAAgB,yBAAyB,CAAI,WAmL3C,SAAS,EAAkB,CAAK,CAAE,CAAY,EAC5C,MAAO,AAJA,AAAiB,UAAjB,OAIkB,GAJW,AAAU,OAIrB,GAJ6B,AAAU,KAIvC,EAAS,EAAQ,CAC5C,CAMA,OApLA,WAIE,IAAI,CAAC,cAAc,CAAG,CACpB,SAAU,GACV,KAAM,GACN,aAAc,GACd,MAAO,GACP,MAAO,EAAE,CACT,WAAY,EAAE,CACd,YAAa,GACb,UAAW,GACX,MAAO,EACT,EA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AAS,CAAC,EAAU,CAAC,IAAI,CAAC,GAEjC,OAAO,IAAI,AACb,CACF,C,G,I,E,E,QC9RF,CAAA,OAAA,OAAA,CAAiB,CAAC,gBAAkB,CAAe","sources":["<anon>","src/js/describedfield.js","src/js/describedfield-ie.js"],"sourcesContent":["\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirec1f2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirec1f2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"aJuQy\", function(module, exports) {\n/**\n * @file Describes a data field of the restructured data.\n * @version {@link https://github.com/JohT/data-restructor-js/releases/latest latest version}\n * @author JohT\n * @version ${project.version}\n */ \"use strict\";\nvar $7d0608def849b52f$var$module = $7d0608def849b52f$var$describedFieldInternalCreateIfNotExists($7d0608def849b52f$var$module); // Fallback for vanilla js without modules\nfunction $7d0608def849b52f$var$describedFieldInternalCreateIfNotExists(objectToCheck) {\n return objectToCheck || {};\n}\n/**\n * Describes a data field of the restructured data.\n * @module described_field\n */ var $7d0608def849b52f$var$described_field = $7d0608def849b52f$var$module.exports = {}; // Export module for npm...\n$7d0608def849b52f$var$described_field.internalCreateIfNotExists = $7d0608def849b52f$var$describedFieldInternalCreateIfNotExists;\n/**\n * Describes a field of the restructured data.\n * Dynamically added properties represent custom named groups containing DescribedDataField-Arrays.\n *\n * @typedef {Object} module:described_field.DescribedDataField\n * @property {string} [category=\"\"] - name of the category. Could contain a short domain name like \"product\" or \"vendor\".\n * @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.\n * @property {string} [abbreviation=\"\"] - one optional character, a symbol character or a short abbreviation of the category\n * @property {string} [image=\"\"] - one optional path to an image resource\n * @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]\n * @property {string[]} groupNames - array of names of all dynamically added properties representing groups\n * @property {string} displayName - display name of the field\n * @property {string} fieldName - field name\n * @property {{*}} value - content of the field\n * @property {module:described_field.DescribedDataField[]} [couldBeAnyCustomGroupName] any number of groups attached to the field each containing multiple fields\n */ $7d0608def849b52f$var$described_field.DescribedDataFieldBuilder = function() {\n /**\n * Builds a {@link module:described_field.DescribedDataField}.\n * DescribedDataField is the main element of the restructured data and therefore considered \"public\".\n * @constructs DescribedDataFieldBuilder\n * @alias module:described_field.DescribedDataFieldBuilder\n */ function DescribedDataFieldBuilder() {\n /**\n * @type {module:described_field.DescribedDataField}\n */ this.describedField = {\n category: \"\",\n type: \"\",\n abbreviation: \"\",\n image: \"\",\n index: [],\n groupNames: [],\n displayName: \"\",\n fieldName: \"\",\n value: \"\"\n };\n /**\n * Takes over all values of the template {@link module:described_field.DescribedDataField}.\n * @function\n * @param {module:described_field.DescribedDataField} template\n * @returns {DescribedDataFieldBuilder}\n * @example fromDescribedDataField(sourceField)\n */ this.fromDescribedDataField = function(template) {\n this.category(template.category);\n this.type(template.type);\n this.abbreviation(template.abbreviation);\n this.image(template.image);\n this.index(template.index);\n this.groupNames(template.groupNames);\n this.displayName(template.displayName);\n this.fieldName(template.fieldName);\n this.value(template.value);\n return this;\n };\n /**\n * Sets the category.\n *\n * Contains a short domain nam, for example:\n * - \"product\" for products\n * - \"vendor\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example category(\"Product\")\n */ this.category = function(value) {\n this.describedField.category = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the type.\n *\n * Contains the type of the entry, for example:\n * - \"summary\" for e.g. a list overview.\n * - \"detail\" e.g. when a summary is selected.\n * - \"filter\" e.g. for field/value pair results that can be selected as search parameters.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example type(\"summary\")\n */ this.type = function(value) {\n this.describedField.type = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional abbreviation.\n *\n * Contains a symbol character or a very short abbreviation of the category.\n * - \"P\" for products\n * - \"V\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example abbreviation(\"P\")\n */ this.abbreviation = function(value) {\n this.describedField.abbreviation = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional path to an image resource.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example image(\"img/product.png\")\n */ this.image = function(value) {\n this.describedField.image = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the index as an array of numbers containing the splitted array indexes of the source field.\n * Example: \"responses[2].hits.hits[4]._source.name\" will have an index of [2,4].\n *\n * @function\n * @param {number[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example index([2,4])\n */ this.index = function(value) {\n this.describedField.index = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the group names as an array of strings containing the names of the dynamically added properties,\n * that contain an array of {@link module:described_field.DescribedDataField}-Objects.\n *\n * @function\n * @param {string[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example groupNames([\"summaries\",\"details\",\"options\"])\n */ this.groupNames = function(value) {\n this.describedField.groupNames = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the display name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example displayName(\"Color\")\n */ this.displayName = function(value) {\n this.describedField.displayName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the (technical) field name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example fieldName(\"color\")\n */ this.fieldName = function(value) {\n this.describedField.fieldName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the value/content of the field.\n *\n * @function\n * @param {*} value\n * @returns {DescribedDataFieldBuilder}\n * @example value(\"darkblue\")\n */ this.value = function(value) {\n this.describedField.value = value;\n return this;\n };\n /**\n * Finalizes the settings and builds the {@link module:described_field.DescribedDataField}.\n * @function\n * @returns {module:described_field.DescribedDataField}\n */ this.build = function() {\n return this.describedField;\n };\n }\n function isSpecifiedString(value) {\n return typeof value === \"string\" && value !== null && value !== \"\";\n }\n function withDefaultString(value, defaultValue) {\n return isSpecifiedString(value) ? value : defaultValue;\n }\n function withDefaultArray(value, defaultValue) {\n return value === undefined || value === null ? defaultValue : value;\n }\n return DescribedDataFieldBuilder;\n}();\n/**\n * Creates a new described data field with all properties of the original one except for dynamically added groups.\n * @param {module:described_field.DescribedDataField} describedDataField\n * @returns {module:described_field.DescribedDataField}\n * @memberof module:described_field\n */ $7d0608def849b52f$var$described_field.copyWithoutGroups = function(describedDataField) {\n return new $7d0608def849b52f$var$described_field.DescribedDataFieldBuilder().fromDescribedDataField(describedDataField).groupNames([]).build();\n};\n$7d0608def849b52f$var$described_field.DescribedDataFieldGroup = function() {\n /**\n * Adds groups to {@link module:described_field.DescribedDataField}s. These groups are dynamically added properties\n * that contain an array of sub fields of the same type {@link module:described_field.DescribedDataField}s.\n *\n * @param {module:described_field.DescribedDataField} dataField\n * @constructs DescribedDataFieldGroup\n * @alias module:described_field.DescribedDataFieldGroup\n * @example new described_field.DescribedDataFieldGroup(field).addGroupEntry(\"details\", detailField);\n */ function DescribedDataFieldGroup(dataField) {\n this.dataField = dataField;\n /**\n * Adds an entry to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entry will be added\n * @param {module:described_field.DescribedDataField} describedField sub field that is added to the group\n * @returns {DescribedDataFieldGroup}\n */ this.addGroupEntry = function(groupName, describedField) {\n this.addGroupEntries(groupName, [\n describedField\n ]);\n return this;\n };\n /**\n * Adds entries to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entries will be added\n * @param {module:described_field.DescribedDataField[]} describedFields sub fields that are added to the group\n * @returns {DescribedDataFieldGroup}\n */ this.addGroupEntries = function(groupName, describedFields) {\n if (!groupName || groupName.length === 0) return this;\n if (!describedFields || describedFields.length === 0) return this;\n if (this.dataField[groupName] === undefined) {\n this.dataField.groupNames.push(groupName);\n this.dataField[groupName] = [];\n }\n var index;\n var describedField;\n for(index = 0; index < describedFields.length; index += 1){\n describedField = describedFields[index];\n this.dataField[groupName].push(describedField);\n }\n return this;\n };\n }\n return DescribedDataFieldGroup;\n}();\n\n});\n\n\"use strict\";\n\nvar $aJuQy = parcelRequire(\"aJuQy\");\nmodule.exports = {\n described_field: $aJuQy\n};\n\n\n//# sourceMappingURL=describedfield-ie.js.map\n","/**\n * @file Describes a data field of the restructured data.\n * @version {@link https://github.com/JohT/data-restructor-js/releases/latest latest version}\n * @author JohT\n * @version ${project.version}\n */\n\"use strict\";\nvar module = describedFieldInternalCreateIfNotExists(module); // Fallback for vanilla js without modules\n\nfunction describedFieldInternalCreateIfNotExists(objectToCheck) {\n return objectToCheck || {};\n}\n\n/**\n * Describes a data field of the restructured data.\n * @module described_field\n */\nvar described_field = (module.exports = {}); // Export module for npm...\ndescribed_field.internalCreateIfNotExists = describedFieldInternalCreateIfNotExists;\n\n/**\n * Describes a field of the restructured data.\n * Dynamically added properties represent custom named groups containing DescribedDataField-Arrays.\n *\n * @typedef {Object} module:described_field.DescribedDataField\n * @property {string} [category=\"\"] - name of the category. Could contain a short domain name like \"product\" or \"vendor\".\n * @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.\n * @property {string} [abbreviation=\"\"] - one optional character, a symbol character or a short abbreviation of the category\n * @property {string} [image=\"\"] - one optional path to an image resource\n * @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]\n * @property {string[]} groupNames - array of names of all dynamically added properties representing groups\n * @property {string} displayName - display name of the field\n * @property {string} fieldName - field name\n * @property {{*}} value - content of the field\n * @property {module:described_field.DescribedDataField[]} [couldBeAnyCustomGroupName] any number of groups attached to the field each containing multiple fields\n */\n\ndescribed_field.DescribedDataFieldBuilder = (function () {\n /**\n * Builds a {@link module:described_field.DescribedDataField}.\n * DescribedDataField is the main element of the restructured data and therefore considered \"public\".\n * @constructs DescribedDataFieldBuilder\n * @alias module:described_field.DescribedDataFieldBuilder\n */\n function DescribedDataFieldBuilder() {\n /**\n * @type {module:described_field.DescribedDataField}\n */\n this.describedField = {\n category: \"\",\n type: \"\",\n abbreviation: \"\",\n image: \"\",\n index: [],\n groupNames: [],\n displayName: \"\",\n fieldName: \"\",\n value: \"\"\n };\n /**\n * Takes over all values of the template {@link module:described_field.DescribedDataField}.\n * @function\n * @param {module:described_field.DescribedDataField} template\n * @returns {DescribedDataFieldBuilder}\n * @example fromDescribedDataField(sourceField)\n */\n this.fromDescribedDataField = function (template) {\n this.category(template.category);\n this.type(template.type);\n this.abbreviation(template.abbreviation);\n this.image(template.image);\n this.index(template.index);\n this.groupNames(template.groupNames);\n this.displayName(template.displayName);\n this.fieldName(template.fieldName);\n this.value(template.value);\n return this;\n };\n /**\n * Sets the category.\n *\n * Contains a short domain nam, for example:\n * - \"product\" for products\n * - \"vendor\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example category(\"Product\")\n */\n this.category = function (value) {\n this.describedField.category = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the type.\n *\n * Contains the type of the entry, for example:\n * - \"summary\" for e.g. a list overview.\n * - \"detail\" e.g. when a summary is selected.\n * - \"filter\" e.g. for field/value pair results that can be selected as search parameters.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example type(\"summary\")\n */\n this.type = function (value) {\n this.describedField.type = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional abbreviation.\n *\n * Contains a symbol character or a very short abbreviation of the category.\n * - \"P\" for products\n * - \"V\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example abbreviation(\"P\")\n */\n this.abbreviation = function (value) {\n this.describedField.abbreviation = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional path to an image resource.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example image(\"img/product.png\")\n */\n this.image = function (value) {\n this.describedField.image = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the index as an array of numbers containing the splitted array indexes of the source field.\n * Example: \"responses[2].hits.hits[4]._source.name\" will have an index of [2,4].\n *\n * @function\n * @param {number[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example index([2,4])\n */\n this.index = function (value) {\n this.describedField.index = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the group names as an array of strings containing the names of the dynamically added properties,\n * that contain an array of {@link module:described_field.DescribedDataField}-Objects.\n *\n * @function\n * @param {string[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example groupNames([\"summaries\",\"details\",\"options\"])\n */\n this.groupNames = function (value) {\n this.describedField.groupNames = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the display name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example displayName(\"Color\")\n */\n this.displayName = function (value) {\n this.describedField.displayName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the (technical) field name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example fieldName(\"color\")\n */\n this.fieldName = function (value) {\n this.describedField.fieldName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the value/content of the field.\n *\n * @function\n * @param {*} value\n * @returns {DescribedDataFieldBuilder}\n * @example value(\"darkblue\")\n */\n this.value = function (value) {\n this.describedField.value = value;\n return this;\n };\n\n /**\n * Finalizes the settings and builds the {@link module:described_field.DescribedDataField}.\n * @function\n * @returns {module:described_field.DescribedDataField}\n */\n this.build = function () {\n return this.describedField;\n };\n }\n\n function isSpecifiedString(value) {\n return typeof value === \"string\" && value !== null && value !== \"\";\n }\n\n function withDefaultString(value, defaultValue) {\n return isSpecifiedString(value) ? value : defaultValue;\n }\n\n function withDefaultArray(value, defaultValue) {\n return value === undefined || value === null ? defaultValue : value;\n }\n\n return DescribedDataFieldBuilder;\n}());\n\n/**\n * Creates a new described data field with all properties of the original one except for dynamically added groups.\n * @param {module:described_field.DescribedDataField} describedDataField\n * @returns {module:described_field.DescribedDataField}\n * @memberof module:described_field\n */\ndescribed_field.copyWithoutGroups = function (describedDataField) {\n return new described_field.DescribedDataFieldBuilder().fromDescribedDataField(describedDataField).groupNames([]).build();\n};\n\ndescribed_field.DescribedDataFieldGroup = (function () {\n /**\n * Adds groups to {@link module:described_field.DescribedDataField}s. These groups are dynamically added properties\n * that contain an array of sub fields of the same type {@link module:described_field.DescribedDataField}s.\n *\n * @param {module:described_field.DescribedDataField} dataField\n * @constructs DescribedDataFieldGroup\n * @alias module:described_field.DescribedDataFieldGroup\n * @example new described_field.DescribedDataFieldGroup(field).addGroupEntry(\"details\", detailField);\n */\n function DescribedDataFieldGroup(dataField) {\n this.dataField = dataField;\n\n /**\n * Adds an entry to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entry will be added\n * @param {module:described_field.DescribedDataField} describedField sub field that is added to the group\n * @returns {DescribedDataFieldGroup}\n */\n this.addGroupEntry = function (groupName, describedField) {\n this.addGroupEntries(groupName, [describedField]);\n return this;\n };\n\n /**\n * Adds entries to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entries will be added\n * @param {module:described_field.DescribedDataField[]} describedFields sub fields that are added to the group\n * @returns {DescribedDataFieldGroup}\n */\n this.addGroupEntries = function (groupName, describedFields) {\n if (!groupName || groupName.length === 0) {\n return this;\n }\n if (!describedFields || describedFields.length === 0) {\n return this;\n }\n if (this.dataField[groupName] === undefined) {\n this.dataField.groupNames.push(groupName);\n this.dataField[groupName] = [];\n }\n var index;\n var describedField;\n for (index = 0; index < describedFields.length; index += 1) {\n describedField = describedFields[index];\n this.dataField[groupName].push(describedField);\n }\n return this;\n };\n }\n\n return DescribedDataFieldGroup;\n}());\n","\"use strict\";\nvar described_field = require(\"../../src/js/describedfield.js\");\nmodule.exports = {described_field : described_field};\n"],"names":["$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$7d0608def849b52f$var$module","$7d0608def849b52f$var$describedFieldInternalCreateIfNotExists","objectToCheck","$7d0608def849b52f$var$described_field","internalCreateIfNotExists","DescribedDataFieldBuilder","withDefaultString","value","defaultValue","isSpecifiedString","describedField","category","type","abbreviation","image","index","groupNames","displayName","fieldName","fromDescribedDataField","template","build","copyWithoutGroups","describedDataField","DescribedDataFieldGroup","dataField","addGroupEntry","groupName","addGroupEntries","describedFields","length","undefined","push","$aJuQy","described_field"],"version":3,"file":"describedfield-ie.js.map","sourceRoot":"../"}
1
+ {"mappings":"A,I,e,W,gB,C,E,c,C,E,c,e,iB,A,O,gB,A,C,c,S,C,E,G,K,gB,O,e,C,E,C,O,C,G,K,c,C,I,E,a,C,E,A,Q,a,C,E,C,I,E,C,G,E,Q,C,C,E,O,e,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,a,C,E,C,C,E,e,iB,C,e,I,e,c,Q,C,e,Q,S,C,C,C,ECMA,aACA,IAAI,EAAS,EAAwC,GAErD,SAAS,EAA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W,CAAC,EAAe,EACzC,IAAI,AACb,EASA,IAAI,CAAC,eAAe,CAAG,SAAU,CAAS,CAAE,CAAe,MAWrD,EACA,EAXJ,GAAI,CAAC,GAAa,AAAqB,IAArB,EAAU,MAAM,EAG9B,CAAC,GAAmB,AAA2B,IAA3B,EAAgB,MAAM,CAF5C,OAAO,IAAI,CAWb,IANkC,KAAA,IAA9B,IAAI,CAAC,SAAS,CAAC,EAAU,GAC3B,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,GAC/B,IAAI,CAAC,SAAS,CAAC,EAAU,CAAG,EAAE,EAI3B,EAAQ,EAAG,EAAQ,EAAgB,MAAM,CAAE,GAAS,EACvD,EAAiB,CAAe,CAAC,EAAM,CACvC,IAAI,CAAC,SAAS,CAAC,EAAU,CAAC,IAAI,CAAC,GAEjC,OAAO,IAAI,AACb,CACF,C,EChSF,CAAA,a,I,O,c,QAEA,CAAA,OAAA,OAAA,CAAiB,CAAC,gBAAkB,MAAe","sources":["<anon>","src/js/describedfield.js","src/js/describedfield-ie.js"],"sourcesContent":["\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirec1f2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirec1f2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"aJuQy\", function(module, exports) {\n/**\n * @file Describes a data field of the restructured data.\n * @version {@link https://github.com/JohT/data-restructor-js/releases/latest latest version}\n * @author JohT\n * @version ${project.version}\n */ \"use strict\";\nvar $7d0608def849b52f$var$module = $7d0608def849b52f$var$describedFieldInternalCreateIfNotExists($7d0608def849b52f$var$module); // Fallback for vanilla js without modules\nfunction $7d0608def849b52f$var$describedFieldInternalCreateIfNotExists(objectToCheck) {\n return objectToCheck || {};\n}\n/**\n * Describes a data field of the restructured data.\n * @module described_field\n */ var $7d0608def849b52f$var$described_field = $7d0608def849b52f$var$module.exports = {}; // Export module for npm...\n$7d0608def849b52f$var$described_field.internalCreateIfNotExists = $7d0608def849b52f$var$describedFieldInternalCreateIfNotExists;\n/**\n * Describes a field of the restructured data.\n * Dynamically added properties represent custom named groups containing DescribedDataField-Arrays.\n *\n * @typedef {Object} module:described_field.DescribedDataField\n * @property {string} [category=\"\"] - name of the category. Could contain a short domain name like \"product\" or \"vendor\".\n * @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.\n * @property {string} [abbreviation=\"\"] - one optional character, a symbol character or a short abbreviation of the category\n * @property {string} [image=\"\"] - one optional path to an image resource\n * @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]\n * @property {string[]} groupNames - array of names of all dynamically added properties representing groups\n * @property {string} displayName - display name of the field\n * @property {string} fieldName - field name\n * @property {{*}} value - content of the field\n * @property {module:described_field.DescribedDataField[]} [couldBeAnyCustomGroupName] any number of groups attached to the field each containing multiple fields\n */ $7d0608def849b52f$var$described_field.DescribedDataFieldBuilder = function() {\n /**\n * Builds a {@link module:described_field.DescribedDataField}.\n * DescribedDataField is the main element of the restructured data and therefore considered \"public\".\n * @constructs DescribedDataFieldBuilder\n * @alias module:described_field.DescribedDataFieldBuilder\n */ function DescribedDataFieldBuilder() {\n /**\n * @type {module:described_field.DescribedDataField}\n */ this.describedField = {\n category: \"\",\n type: \"\",\n abbreviation: \"\",\n image: \"\",\n index: [],\n groupNames: [],\n displayName: \"\",\n fieldName: \"\",\n value: \"\"\n };\n /**\n * Takes over all values of the template {@link module:described_field.DescribedDataField}.\n * @function\n * @param {module:described_field.DescribedDataField} template\n * @returns {DescribedDataFieldBuilder}\n * @example fromDescribedDataField(sourceField)\n */ this.fromDescribedDataField = function(template) {\n this.category(template.category);\n this.type(template.type);\n this.abbreviation(template.abbreviation);\n this.image(template.image);\n this.index(template.index);\n this.groupNames(template.groupNames);\n this.displayName(template.displayName);\n this.fieldName(template.fieldName);\n this.value(template.value);\n return this;\n };\n /**\n * Sets the category.\n *\n * Contains a short domain nam, for example:\n * - \"product\" for products\n * - \"vendor\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example category(\"Product\")\n */ this.category = function(value) {\n this.describedField.category = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the type.\n *\n * Contains the type of the entry, for example:\n * - \"summary\" for e.g. a list overview.\n * - \"detail\" e.g. when a summary is selected.\n * - \"filter\" e.g. for field/value pair results that can be selected as search parameters.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example type(\"summary\")\n */ this.type = function(value) {\n this.describedField.type = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional abbreviation.\n *\n * Contains a symbol character or a very short abbreviation of the category.\n * - \"P\" for products\n * - \"V\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example abbreviation(\"P\")\n */ this.abbreviation = function(value) {\n this.describedField.abbreviation = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional path to an image resource.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example image(\"img/product.png\")\n */ this.image = function(value) {\n this.describedField.image = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the index as an array of numbers containing the splitted array indexes of the source field.\n * Example: \"responses[2].hits.hits[4]._source.name\" will have an index of [2,4].\n *\n * @function\n * @param {number[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example index([2,4])\n */ this.index = function(value) {\n this.describedField.index = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the group names as an array of strings containing the names of the dynamically added properties,\n * that contain an array of {@link module:described_field.DescribedDataField}-Objects.\n *\n * @function\n * @param {string[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example groupNames([\"summaries\",\"details\",\"options\"])\n */ this.groupNames = function(value) {\n this.describedField.groupNames = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the display name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example displayName(\"Color\")\n */ this.displayName = function(value) {\n this.describedField.displayName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the (technical) field name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example fieldName(\"color\")\n */ this.fieldName = function(value) {\n this.describedField.fieldName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the value/content of the field.\n *\n * @function\n * @param {*} value\n * @returns {DescribedDataFieldBuilder}\n * @example value(\"darkblue\")\n */ this.value = function(value) {\n this.describedField.value = value;\n return this;\n };\n /**\n * Finalizes the settings and builds the {@link module:described_field.DescribedDataField}.\n * @function\n * @returns {module:described_field.DescribedDataField}\n */ this.build = function() {\n return this.describedField;\n };\n }\n function isSpecifiedString(value) {\n return typeof value === \"string\" && value !== null && value !== \"\";\n }\n function withDefaultString(value, defaultValue) {\n return isSpecifiedString(value) ? value : defaultValue;\n }\n function withDefaultArray(value, defaultValue) {\n return value === undefined || value === null ? defaultValue : value;\n }\n return DescribedDataFieldBuilder;\n}();\n/**\n * Creates a new described data field with all properties of the original one except for dynamically added groups.\n * @param {module:described_field.DescribedDataField} describedDataField\n * @returns {module:described_field.DescribedDataField}\n * @memberof module:described_field\n */ $7d0608def849b52f$var$described_field.copyWithoutGroups = function(describedDataField) {\n return new $7d0608def849b52f$var$described_field.DescribedDataFieldBuilder().fromDescribedDataField(describedDataField).groupNames([]).build();\n};\n$7d0608def849b52f$var$described_field.DescribedDataFieldGroup = function() {\n /**\n * Adds groups to {@link module:described_field.DescribedDataField}s. These groups are dynamically added properties\n * that contain an array of sub fields of the same type {@link module:described_field.DescribedDataField}s.\n *\n * @param {module:described_field.DescribedDataField} dataField\n * @constructs DescribedDataFieldGroup\n * @alias module:described_field.DescribedDataFieldGroup\n * @example new described_field.DescribedDataFieldGroup(field).addGroupEntry(\"details\", detailField);\n */ function DescribedDataFieldGroup(dataField) {\n this.dataField = dataField;\n /**\n * Adds an entry to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entry will be added\n * @param {module:described_field.DescribedDataField} describedField sub field that is added to the group\n * @returns {DescribedDataFieldGroup}\n */ this.addGroupEntry = function(groupName, describedField) {\n this.addGroupEntries(groupName, [\n describedField\n ]);\n return this;\n };\n /**\n * Adds entries to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entries will be added\n * @param {module:described_field.DescribedDataField[]} describedFields sub fields that are added to the group\n * @returns {DescribedDataFieldGroup}\n */ this.addGroupEntries = function(groupName, describedFields) {\n if (!groupName || groupName.length === 0) return this;\n if (!describedFields || describedFields.length === 0) return this;\n if (this.dataField[groupName] === undefined) {\n this.dataField.groupNames.push(groupName);\n this.dataField[groupName] = [];\n }\n var index;\n var describedField;\n for(index = 0; index < describedFields.length; index += 1){\n describedField = describedFields[index];\n this.dataField[groupName].push(describedField);\n }\n return this;\n };\n }\n return DescribedDataFieldGroup;\n}();\n\n});\n\n\"use strict\";\n\nvar $aJuQy = parcelRequire(\"aJuQy\");\nmodule.exports = {\n described_field: $aJuQy\n};\n\n\n//# sourceMappingURL=describedfield-ie.js.map\n","/**\n * @file Describes a data field of the restructured data.\n * @version {@link https://github.com/JohT/data-restructor-js/releases/latest latest version}\n * @author JohT\n * @version ${project.version}\n */\n\"use strict\";\nvar module = describedFieldInternalCreateIfNotExists(module); // Fallback for vanilla js without modules\n\nfunction describedFieldInternalCreateIfNotExists(objectToCheck) {\n return objectToCheck || {};\n}\n\n/**\n * Describes a data field of the restructured data.\n * @module described_field\n */\nvar described_field = (module.exports = {}); // Export module for npm...\ndescribed_field.internalCreateIfNotExists = describedFieldInternalCreateIfNotExists;\n\n/**\n * Describes a field of the restructured data.\n * Dynamically added properties represent custom named groups containing DescribedDataField-Arrays.\n *\n * @typedef {Object} module:described_field.DescribedDataField\n * @property {string} [category=\"\"] - name of the category. Could contain a short domain name like \"product\" or \"vendor\".\n * @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.\n * @property {string} [abbreviation=\"\"] - one optional character, a symbol character or a short abbreviation of the category\n * @property {string} [image=\"\"] - one optional path to an image resource\n * @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]\n * @property {string[]} groupNames - array of names of all dynamically added properties representing groups\n * @property {string} displayName - display name of the field\n * @property {string} fieldName - field name\n * @property {{*}} value - content of the field\n * @property {module:described_field.DescribedDataField[]} [couldBeAnyCustomGroupName] any number of groups attached to the field each containing multiple fields\n */\n\ndescribed_field.DescribedDataFieldBuilder = (function () {\n /**\n * Builds a {@link module:described_field.DescribedDataField}.\n * DescribedDataField is the main element of the restructured data and therefore considered \"public\".\n * @constructs DescribedDataFieldBuilder\n * @alias module:described_field.DescribedDataFieldBuilder\n */\n function DescribedDataFieldBuilder() {\n /**\n * @type {module:described_field.DescribedDataField}\n */\n this.describedField = {\n category: \"\",\n type: \"\",\n abbreviation: \"\",\n image: \"\",\n index: [],\n groupNames: [],\n displayName: \"\",\n fieldName: \"\",\n value: \"\"\n };\n /**\n * Takes over all values of the template {@link module:described_field.DescribedDataField}.\n * @function\n * @param {module:described_field.DescribedDataField} template\n * @returns {DescribedDataFieldBuilder}\n * @example fromDescribedDataField(sourceField)\n */\n this.fromDescribedDataField = function (template) {\n this.category(template.category);\n this.type(template.type);\n this.abbreviation(template.abbreviation);\n this.image(template.image);\n this.index(template.index);\n this.groupNames(template.groupNames);\n this.displayName(template.displayName);\n this.fieldName(template.fieldName);\n this.value(template.value);\n return this;\n };\n /**\n * Sets the category.\n *\n * Contains a short domain nam, for example:\n * - \"product\" for products\n * - \"vendor\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example category(\"Product\")\n */\n this.category = function (value) {\n this.describedField.category = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the type.\n *\n * Contains the type of the entry, for example:\n * - \"summary\" for e.g. a list overview.\n * - \"detail\" e.g. when a summary is selected.\n * - \"filter\" e.g. for field/value pair results that can be selected as search parameters.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example type(\"summary\")\n */\n this.type = function (value) {\n this.describedField.type = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional abbreviation.\n *\n * Contains a symbol character or a very short abbreviation of the category.\n * - \"P\" for products\n * - \"V\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example abbreviation(\"P\")\n */\n this.abbreviation = function (value) {\n this.describedField.abbreviation = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional path to an image resource.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example image(\"img/product.png\")\n */\n this.image = function (value) {\n this.describedField.image = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the index as an array of numbers containing the splitted array indexes of the source field.\n * Example: \"responses[2].hits.hits[4]._source.name\" will have an index of [2,4].\n *\n * @function\n * @param {number[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example index([2,4])\n */\n this.index = function (value) {\n this.describedField.index = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the group names as an array of strings containing the names of the dynamically added properties,\n * that contain an array of {@link module:described_field.DescribedDataField}-Objects.\n *\n * @function\n * @param {string[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example groupNames([\"summaries\",\"details\",\"options\"])\n */\n this.groupNames = function (value) {\n this.describedField.groupNames = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the display name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example displayName(\"Color\")\n */\n this.displayName = function (value) {\n this.describedField.displayName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the (technical) field name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example fieldName(\"color\")\n */\n this.fieldName = function (value) {\n this.describedField.fieldName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the value/content of the field.\n *\n * @function\n * @param {*} value\n * @returns {DescribedDataFieldBuilder}\n * @example value(\"darkblue\")\n */\n this.value = function (value) {\n this.describedField.value = value;\n return this;\n };\n\n /**\n * Finalizes the settings and builds the {@link module:described_field.DescribedDataField}.\n * @function\n * @returns {module:described_field.DescribedDataField}\n */\n this.build = function () {\n return this.describedField;\n };\n }\n\n function isSpecifiedString(value) {\n return typeof value === \"string\" && value !== null && value !== \"\";\n }\n\n function withDefaultString(value, defaultValue) {\n return isSpecifiedString(value) ? value : defaultValue;\n }\n\n function withDefaultArray(value, defaultValue) {\n return value === undefined || value === null ? defaultValue : value;\n }\n\n return DescribedDataFieldBuilder;\n}());\n\n/**\n * Creates a new described data field with all properties of the original one except for dynamically added groups.\n * @param {module:described_field.DescribedDataField} describedDataField\n * @returns {module:described_field.DescribedDataField}\n * @memberof module:described_field\n */\ndescribed_field.copyWithoutGroups = function (describedDataField) {\n return new described_field.DescribedDataFieldBuilder().fromDescribedDataField(describedDataField).groupNames([]).build();\n};\n\ndescribed_field.DescribedDataFieldGroup = (function () {\n /**\n * Adds groups to {@link module:described_field.DescribedDataField}s. These groups are dynamically added properties\n * that contain an array of sub fields of the same type {@link module:described_field.DescribedDataField}s.\n *\n * @param {module:described_field.DescribedDataField} dataField\n * @constructs DescribedDataFieldGroup\n * @alias module:described_field.DescribedDataFieldGroup\n * @example new described_field.DescribedDataFieldGroup(field).addGroupEntry(\"details\", detailField);\n */\n function DescribedDataFieldGroup(dataField) {\n this.dataField = dataField;\n\n /**\n * Adds an entry to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entry will be added\n * @param {module:described_field.DescribedDataField} describedField sub field that is added to the group\n * @returns {DescribedDataFieldGroup}\n */\n this.addGroupEntry = function (groupName, describedField) {\n this.addGroupEntries(groupName, [describedField]);\n return this;\n };\n\n /**\n * Adds entries to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entries will be added\n * @param {module:described_field.DescribedDataField[]} describedFields sub fields that are added to the group\n * @returns {DescribedDataFieldGroup}\n */\n this.addGroupEntries = function (groupName, describedFields) {\n if (!groupName || groupName.length === 0) {\n return this;\n }\n if (!describedFields || describedFields.length === 0) {\n return this;\n }\n if (this.dataField[groupName] === undefined) {\n this.dataField.groupNames.push(groupName);\n this.dataField[groupName] = [];\n }\n var index;\n var describedField;\n for (index = 0; index < describedFields.length; index += 1) {\n describedField = describedFields[index];\n this.dataField[groupName].push(describedField);\n }\n return this;\n };\n }\n\n return DescribedDataFieldGroup;\n}());\n","\"use strict\";\nvar described_field = require(\"../../src/js/describedfield.js\");\nmodule.exports = {described_field : described_field};\n"],"names":["$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$7d0608def849b52f$var$module","$7d0608def849b52f$var$describedFieldInternalCreateIfNotExists","objectToCheck","$7d0608def849b52f$var$described_field","internalCreateIfNotExists","DescribedDataFieldBuilder","withDefaultString","value","defaultValue","isSpecifiedString","describedField","category","type","abbreviation","image","index","groupNames","displayName","fieldName","fromDescribedDataField","template","build","copyWithoutGroups","describedDataField","DescribedDataFieldGroup","dataField","addGroupEntry","groupName","addGroupEntries","describedFields","length","undefined","push","$aJuQy","described_field"],"version":3,"file":"describedfield-ie.js.map","sourceRoot":"../"}
@@ -1,2 +1,2 @@
1
- var i=globalThis,e={},t={},r=i.parcelRequirec1f2;null==r&&((r=function(i){if(i in e)return e[i].exports;if(i in t){var r=t[i];delete t[i];var s={id:i,exports:{}};return e[i]=s,r.call(s.exports,s,s.exports),s.exports}var n=Error("Cannot find module '"+i+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(i,e){t[i]=e},i.parcelRequirec1f2=r),(0,r.register)("aJuQy",function(i,e){var t=r(t);function r(i){return i||{}}var s=t.exports={};s.internalCreateIfNotExists=r,s.DescribedDataFieldBuilder=function(){function i(i,e){return"string"==typeof i&&null!==i&&""!==i?i:e}return function(){this.describedField={category:"",type:"",abbreviation:"",image:"",index:[],groupNames:[],displayName:"",fieldName:"",value:""},this.fromDescribedDataField=function(i){return this.category(i.category),this.type(i.type),this.abbreviation(i.abbreviation),this.image(i.image),this.index(i.index),this.groupNames(i.groupNames),this.displayName(i.displayName),this.fieldName(i.fieldName),this.value(i.value),this},this.category=function(e){return this.describedField.category=i(e,""),this},this.type=function(e){return this.describedField.type=i(e,""),this},this.abbreviation=function(e){return this.describedField.abbreviation=i(e,""),this},this.image=function(e){return this.describedField.image=i(e,""),this},this.index=function(i){var e;return this.describedField.index=(e=[],null==i?e:i),this},this.groupNames=function(i){var e;return this.describedField.groupNames=(e=[],null==i?e:i),this},this.displayName=function(e){return this.describedField.displayName=i(e,""),this},this.fieldName=function(e){return this.describedField.fieldName=i(e,""),this},this.value=function(i){return this.describedField.value=i,this},this.build=function(){return this.describedField}}}(),s.copyWithoutGroups=function(i){return new s.DescribedDataFieldBuilder().fromDescribedDataField(i).groupNames([]).build()},s.DescribedDataFieldGroup=function(i){this.dataField=i,this.addGroupEntry=function(i,e){return this.addGroupEntries(i,[e]),this},this.addGroupEntries=function(i,e){var t,r;if(!i||0===i.length||!e||0===e.length)return this;for(void 0===this.dataField[i]&&(this.dataField.groupNames.push(i),this.dataField[i]=[]),t=0;t<e.length;t+=1)r=e[t],this.dataField[i].push(r);return this}}}),r("aJuQy");
1
+ var $parcel$global=globalThis,$parcel$modules={},$parcel$inits={},parcelRequire=$parcel$global.parcelRequirec1f2;null==parcelRequire&&((parcelRequire=function(e){if(e in $parcel$modules)return $parcel$modules[e].exports;if(e in $parcel$inits){var i=$parcel$inits[e];delete $parcel$inits[e];var t={id:e,exports:{}};return $parcel$modules[e]=t,i.call(t.exports,t,t.exports),t.exports}var r=Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(e,i){$parcel$inits[e]=i},$parcel$global.parcelRequirec1f2=parcelRequire);var parcelRegister=parcelRequire.register;parcelRegister("aJuQy",function(e,i){"use strict";var t=r(t);function r(e){return e||{}}var a=t.exports={};a.internalCreateIfNotExists=r,a.DescribedDataFieldBuilder=function(){function e(e,i){return"string"==typeof e&&null!==e&&""!==e?e:i}return function(){this.describedField={category:"",type:"",abbreviation:"",image:"",index:[],groupNames:[],displayName:"",fieldName:"",value:""},this.fromDescribedDataField=function(e){return this.category(e.category),this.type(e.type),this.abbreviation(e.abbreviation),this.image(e.image),this.index(e.index),this.groupNames(e.groupNames),this.displayName(e.displayName),this.fieldName(e.fieldName),this.value(e.value),this},this.category=function(i){return this.describedField.category=e(i,""),this},this.type=function(i){return this.describedField.type=e(i,""),this},this.abbreviation=function(i){return this.describedField.abbreviation=e(i,""),this},this.image=function(i){return this.describedField.image=e(i,""),this},this.index=function(e){var i,t;return this.describedField.index=(t=[],null==(i=e)?t:i),this},this.groupNames=function(e){var i,t;return this.describedField.groupNames=(t=[],null==(i=e)?t:i),this},this.displayName=function(i){return this.describedField.displayName=e(i,""),this},this.fieldName=function(i){return this.describedField.fieldName=e(i,""),this},this.value=function(e){return this.describedField.value=e,this},this.build=function(){return this.describedField}}}(),a.copyWithoutGroups=function(e){return new a.DescribedDataFieldBuilder().fromDescribedDataField(e).groupNames([]).build()},a.DescribedDataFieldGroup=function(e){this.dataField=e,this.addGroupEntry=function(e,i){return this.addGroupEntries(e,[i]),this},this.addGroupEntries=function(e,i){var t,r;if(!e||0===e.length||!i||0===i.length)return this;for(void 0===this.dataField[e]&&(this.dataField.groupNames.push(e),this.dataField[e]=[]),t=0;t<i.length;t+=1)r=i[t],this.dataField[e].push(r);return this}}}),parcelRequire("aJuQy");
2
2
  //# sourceMappingURL=describedfield.js.map
@@ -1 +1 @@
1
- {"mappings":"A,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,A,C,E,E,Q,A,E,Q,S,C,C,C,ECOA,IAAI,EAAS,EAAwC,GAErD,SAAS,EAAwC,CAAa,EAC5D,OAAO,GAAiB,CAAC,CAC3B,CAMA,IAAI,EAAmB,EAAO,OAAO,CAAG,CAAC,CACzC,CAAA,EAAgB,yBAAyB,CAAG,EAmB5C,EAAgB,yBAAyB,CAAI,WAmL3C,SAAS,EAAkB,CAAK,CAAE,CAAY,EAC5C,MAAO,AAJA,AAAiB,UAAjB,OAIkB,GAJW,AAAU,OAIrB,GAJ6B,AAAU,KAIvC,EAAS,EAAQ,CAC5C,CAMA,OApLA,WAIE,IAAI,CAAC,cAAc,CAAG,CACpB,SAAU,GACV,KAAM,GACN,aAAc,GACd,MAAO,GACP,MAAO,EAAE,CACT,WAAY,EAAE,CACd,YAAa,GACb,UAAW,GACX,MAAO,EACT,EAQA,IAAI,CAAC,sBAAsB,CAAG,SAAU,CAAQ,EAU9C,OATA,IAAI,CAAC,QAAQ,CAAC,EAAS,QAAQ,EAC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sourcesContent":["\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirec1f2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirec1f2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"aJuQy\", function(module, exports) {\n/**\n * @file Describes a data field of the restructured data.\n * @version {@link https://github.com/JohT/data-restructor-js/releases/latest latest version}\n * @author JohT\n * @version ${project.version}\n */ \"use strict\";\nvar $7d0608def849b52f$var$module = $7d0608def849b52f$var$describedFieldInternalCreateIfNotExists($7d0608def849b52f$var$module); // Fallback for vanilla js without modules\nfunction $7d0608def849b52f$var$describedFieldInternalCreateIfNotExists(objectToCheck) {\n return objectToCheck || {};\n}\n/**\n * Describes a data field of the restructured data.\n * @module described_field\n */ var $7d0608def849b52f$var$described_field = $7d0608def849b52f$var$module.exports = {}; // Export module for npm...\n$7d0608def849b52f$var$described_field.internalCreateIfNotExists = $7d0608def849b52f$var$describedFieldInternalCreateIfNotExists;\n/**\n * Describes a field of the restructured data.\n * Dynamically added properties represent custom named groups containing DescribedDataField-Arrays.\n *\n * @typedef {Object} module:described_field.DescribedDataField\n * @property {string} [category=\"\"] - name of the category. Could contain a short domain name like \"product\" or \"vendor\".\n * @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.\n * @property {string} [abbreviation=\"\"] - one optional character, a symbol character or a short abbreviation of the category\n * @property {string} [image=\"\"] - one optional path to an image resource\n * @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]\n * @property {string[]} groupNames - array of names of all dynamically added properties representing groups\n * @property {string} displayName - display name of the field\n * @property {string} fieldName - field name\n * @property {{*}} value - content of the field\n * @property {module:described_field.DescribedDataField[]} [couldBeAnyCustomGroupName] any number of groups attached to the field each containing multiple fields\n */ $7d0608def849b52f$var$described_field.DescribedDataFieldBuilder = function() {\n /**\n * Builds a {@link module:described_field.DescribedDataField}.\n * DescribedDataField is the main element of the restructured data and therefore considered \"public\".\n * @constructs DescribedDataFieldBuilder\n * @alias module:described_field.DescribedDataFieldBuilder\n */ function DescribedDataFieldBuilder() {\n /**\n * @type {module:described_field.DescribedDataField}\n */ this.describedField = {\n category: \"\",\n type: \"\",\n abbreviation: \"\",\n image: \"\",\n index: [],\n groupNames: [],\n displayName: \"\",\n fieldName: \"\",\n value: \"\"\n };\n /**\n * Takes over all values of the template {@link module:described_field.DescribedDataField}.\n * @function\n * @param {module:described_field.DescribedDataField} template\n * @returns {DescribedDataFieldBuilder}\n * @example fromDescribedDataField(sourceField)\n */ this.fromDescribedDataField = function(template) {\n this.category(template.category);\n this.type(template.type);\n this.abbreviation(template.abbreviation);\n this.image(template.image);\n this.index(template.index);\n this.groupNames(template.groupNames);\n this.displayName(template.displayName);\n this.fieldName(template.fieldName);\n this.value(template.value);\n return this;\n };\n /**\n * Sets the category.\n *\n * Contains a short domain nam, for example:\n * - \"product\" for products\n * - \"vendor\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example category(\"Product\")\n */ this.category = function(value) {\n this.describedField.category = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the type.\n *\n * Contains the type of the entry, for example:\n * - \"summary\" for e.g. a list overview.\n * - \"detail\" e.g. when a summary is selected.\n * - \"filter\" e.g. for field/value pair results that can be selected as search parameters.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example type(\"summary\")\n */ this.type = function(value) {\n this.describedField.type = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional abbreviation.\n *\n * Contains a symbol character or a very short abbreviation of the category.\n * - \"P\" for products\n * - \"V\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example abbreviation(\"P\")\n */ this.abbreviation = function(value) {\n this.describedField.abbreviation = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional path to an image resource.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example image(\"img/product.png\")\n */ this.image = function(value) {\n this.describedField.image = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the index as an array of numbers containing the splitted array indexes of the source field.\n * Example: \"responses[2].hits.hits[4]._source.name\" will have an index of [2,4].\n *\n * @function\n * @param {number[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example index([2,4])\n */ this.index = function(value) {\n this.describedField.index = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the group names as an array of strings containing the names of the dynamically added properties,\n * that contain an array of {@link module:described_field.DescribedDataField}-Objects.\n *\n * @function\n * @param {string[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example groupNames([\"summaries\",\"details\",\"options\"])\n */ this.groupNames = function(value) {\n this.describedField.groupNames = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the display name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example displayName(\"Color\")\n */ this.displayName = function(value) {\n this.describedField.displayName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the (technical) field name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example fieldName(\"color\")\n */ this.fieldName = function(value) {\n this.describedField.fieldName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the value/content of the field.\n *\n * @function\n * @param {*} value\n * @returns {DescribedDataFieldBuilder}\n * @example value(\"darkblue\")\n */ this.value = function(value) {\n this.describedField.value = value;\n return this;\n };\n /**\n * Finalizes the settings and builds the {@link module:described_field.DescribedDataField}.\n * @function\n * @returns {module:described_field.DescribedDataField}\n */ this.build = function() {\n return this.describedField;\n };\n }\n function isSpecifiedString(value) {\n return typeof value === \"string\" && value !== null && value !== \"\";\n }\n function withDefaultString(value, defaultValue) {\n return isSpecifiedString(value) ? value : defaultValue;\n }\n function withDefaultArray(value, defaultValue) {\n return value === undefined || value === null ? defaultValue : value;\n }\n return DescribedDataFieldBuilder;\n}();\n/**\n * Creates a new described data field with all properties of the original one except for dynamically added groups.\n * @param {module:described_field.DescribedDataField} describedDataField\n * @returns {module:described_field.DescribedDataField}\n * @memberof module:described_field\n */ $7d0608def849b52f$var$described_field.copyWithoutGroups = function(describedDataField) {\n return new $7d0608def849b52f$var$described_field.DescribedDataFieldBuilder().fromDescribedDataField(describedDataField).groupNames([]).build();\n};\n$7d0608def849b52f$var$described_field.DescribedDataFieldGroup = function() {\n /**\n * Adds groups to {@link module:described_field.DescribedDataField}s. These groups are dynamically added properties\n * that contain an array of sub fields of the same type {@link module:described_field.DescribedDataField}s.\n *\n * @param {module:described_field.DescribedDataField} dataField\n * @constructs DescribedDataFieldGroup\n * @alias module:described_field.DescribedDataFieldGroup\n * @example new described_field.DescribedDataFieldGroup(field).addGroupEntry(\"details\", detailField);\n */ function DescribedDataFieldGroup(dataField) {\n this.dataField = dataField;\n /**\n * Adds an entry to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entry will be added\n * @param {module:described_field.DescribedDataField} describedField sub field that is added to the group\n * @returns {DescribedDataFieldGroup}\n */ this.addGroupEntry = function(groupName, describedField) {\n this.addGroupEntries(groupName, [\n describedField\n ]);\n return this;\n };\n /**\n * Adds entries to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entries will be added\n * @param {module:described_field.DescribedDataField[]} describedFields sub fields that are added to the group\n * @returns {DescribedDataFieldGroup}\n */ this.addGroupEntries = function(groupName, describedFields) {\n if (!groupName || groupName.length === 0) return this;\n if (!describedFields || describedFields.length === 0) return this;\n if (this.dataField[groupName] === undefined) {\n this.dataField.groupNames.push(groupName);\n this.dataField[groupName] = [];\n }\n var index;\n var describedField;\n for(index = 0; index < describedFields.length; index += 1){\n describedField = describedFields[index];\n this.dataField[groupName].push(describedField);\n }\n return this;\n };\n }\n return DescribedDataFieldGroup;\n}();\n\n});\n\n\nparcelRequire(\"aJuQy\");\n\n//# sourceMappingURL=describedfield.js.map\n","/**\n * @file Describes a data field of the restructured data.\n * @version {@link https://github.com/JohT/data-restructor-js/releases/latest latest version}\n * @author JohT\n * @version ${project.version}\n */\n\"use strict\";\nvar module = describedFieldInternalCreateIfNotExists(module); // Fallback for vanilla js without modules\n\nfunction describedFieldInternalCreateIfNotExists(objectToCheck) {\n return objectToCheck || {};\n}\n\n/**\n * Describes a data field of the restructured data.\n * @module described_field\n */\nvar described_field = (module.exports = {}); // Export module for npm...\ndescribed_field.internalCreateIfNotExists = describedFieldInternalCreateIfNotExists;\n\n/**\n * Describes a field of the restructured data.\n * Dynamically added properties represent custom named groups containing DescribedDataField-Arrays.\n *\n * @typedef {Object} module:described_field.DescribedDataField\n * @property {string} [category=\"\"] - name of the category. Could contain a short domain name like \"product\" or \"vendor\".\n * @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.\n * @property {string} [abbreviation=\"\"] - one optional character, a symbol character or a short abbreviation of the category\n * @property {string} [image=\"\"] - one optional path to an image resource\n * @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]\n * @property {string[]} groupNames - array of names of all dynamically added properties representing groups\n * @property {string} displayName - display name of the field\n * @property {string} fieldName - field name\n * @property {{*}} value - content of the field\n * @property {module:described_field.DescribedDataField[]} [couldBeAnyCustomGroupName] any number of groups attached to the field each containing multiple fields\n */\n\ndescribed_field.DescribedDataFieldBuilder = (function () {\n /**\n * Builds a {@link module:described_field.DescribedDataField}.\n * DescribedDataField is the main element of the restructured data and therefore considered \"public\".\n * @constructs DescribedDataFieldBuilder\n * @alias module:described_field.DescribedDataFieldBuilder\n */\n function DescribedDataFieldBuilder() {\n /**\n * @type {module:described_field.DescribedDataField}\n */\n this.describedField = {\n category: \"\",\n type: \"\",\n abbreviation: \"\",\n image: \"\",\n index: [],\n groupNames: [],\n displayName: \"\",\n fieldName: \"\",\n value: \"\"\n };\n /**\n * Takes over all values of the template {@link module:described_field.DescribedDataField}.\n * @function\n * @param {module:described_field.DescribedDataField} template\n * @returns {DescribedDataFieldBuilder}\n * @example fromDescribedDataField(sourceField)\n */\n this.fromDescribedDataField = function (template) {\n this.category(template.category);\n this.type(template.type);\n this.abbreviation(template.abbreviation);\n this.image(template.image);\n this.index(template.index);\n this.groupNames(template.groupNames);\n this.displayName(template.displayName);\n this.fieldName(template.fieldName);\n this.value(template.value);\n return this;\n };\n /**\n * Sets the category.\n *\n * Contains a short domain nam, for example:\n * - \"product\" for products\n * - \"vendor\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example category(\"Product\")\n */\n this.category = function (value) {\n this.describedField.category = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the type.\n *\n * Contains the type of the entry, for example:\n * - \"summary\" for e.g. a list overview.\n * - \"detail\" e.g. when a summary is selected.\n * - \"filter\" e.g. for field/value pair results that can be selected as search parameters.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example type(\"summary\")\n */\n this.type = function (value) {\n this.describedField.type = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional abbreviation.\n *\n * Contains a symbol character or a very short abbreviation of the category.\n * - \"P\" for products\n * - \"V\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example abbreviation(\"P\")\n */\n this.abbreviation = function (value) {\n this.describedField.abbreviation = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional path to an image resource.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example image(\"img/product.png\")\n */\n this.image = function (value) {\n this.describedField.image = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the index as an array of numbers containing the splitted array indexes of the source field.\n * Example: \"responses[2].hits.hits[4]._source.name\" will have an index of [2,4].\n *\n * @function\n * @param {number[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example index([2,4])\n */\n this.index = function (value) {\n this.describedField.index = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the group names as an array of strings containing the names of the dynamically added properties,\n * that contain an array of {@link module:described_field.DescribedDataField}-Objects.\n *\n * @function\n * @param {string[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example groupNames([\"summaries\",\"details\",\"options\"])\n */\n this.groupNames = function (value) {\n this.describedField.groupNames = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the display name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example displayName(\"Color\")\n */\n this.displayName = function (value) {\n this.describedField.displayName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the (technical) field name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example fieldName(\"color\")\n */\n this.fieldName = function (value) {\n this.describedField.fieldName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the value/content of the field.\n *\n * @function\n * @param {*} value\n * @returns {DescribedDataFieldBuilder}\n * @example value(\"darkblue\")\n */\n this.value = function (value) {\n this.describedField.value = value;\n return this;\n };\n\n /**\n * Finalizes the settings and builds the {@link module:described_field.DescribedDataField}.\n * @function\n * @returns {module:described_field.DescribedDataField}\n */\n this.build = function () {\n return this.describedField;\n };\n }\n\n function isSpecifiedString(value) {\n return typeof value === \"string\" && value !== null && value !== \"\";\n }\n\n function withDefaultString(value, defaultValue) {\n return isSpecifiedString(value) ? value : defaultValue;\n }\n\n function withDefaultArray(value, defaultValue) {\n return value === undefined || value === null ? defaultValue : value;\n }\n\n return DescribedDataFieldBuilder;\n}());\n\n/**\n * Creates a new described data field with all properties of the original one except for dynamically added groups.\n * @param {module:described_field.DescribedDataField} describedDataField\n * @returns {module:described_field.DescribedDataField}\n * @memberof module:described_field\n */\ndescribed_field.copyWithoutGroups = function (describedDataField) {\n return new described_field.DescribedDataFieldBuilder().fromDescribedDataField(describedDataField).groupNames([]).build();\n};\n\ndescribed_field.DescribedDataFieldGroup = (function () {\n /**\n * Adds groups to {@link module:described_field.DescribedDataField}s. These groups are dynamically added properties\n * that contain an array of sub fields of the same type {@link module:described_field.DescribedDataField}s.\n *\n * @param {module:described_field.DescribedDataField} dataField\n * @constructs DescribedDataFieldGroup\n * @alias module:described_field.DescribedDataFieldGroup\n * @example new described_field.DescribedDataFieldGroup(field).addGroupEntry(\"details\", detailField);\n */\n function DescribedDataFieldGroup(dataField) {\n this.dataField = dataField;\n\n /**\n * Adds an entry to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entry will be added\n * @param {module:described_field.DescribedDataField} describedField sub field that is added to the group\n * @returns {DescribedDataFieldGroup}\n */\n this.addGroupEntry = function (groupName, describedField) {\n this.addGroupEntries(groupName, [describedField]);\n return this;\n };\n\n /**\n * Adds entries to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entries will be added\n * @param {module:described_field.DescribedDataField[]} describedFields sub fields that are added to the group\n * @returns {DescribedDataFieldGroup}\n */\n this.addGroupEntries = function (groupName, describedFields) {\n if (!groupName || groupName.length === 0) {\n return this;\n }\n if (!describedFields || describedFields.length === 0) {\n return this;\n }\n if (this.dataField[groupName] === undefined) {\n this.dataField.groupNames.push(groupName);\n this.dataField[groupName] = [];\n }\n var index;\n var describedField;\n for (index = 0; index < describedFields.length; index += 1) {\n describedField = describedFields[index];\n this.dataField[groupName].push(describedField);\n }\n return this;\n };\n }\n\n return DescribedDataFieldGroup;\n}());\n"],"names":["$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$7d0608def849b52f$var$module","$7d0608def849b52f$var$describedFieldInternalCreateIfNotExists","objectToCheck","$7d0608def849b52f$var$described_field","internalCreateIfNotExists","DescribedDataFieldBuilder","withDefaultString","value","defaultValue","isSpecifiedString","describedField","category","type","abbreviation","image","index","groupNames","displayName","fieldName","fromDescribedDataField","template","build","copyWithoutGroups","describedDataField","DescribedDataFieldGroup","dataField","addGroupEntry","groupName","addGroupEntries","describedFields","length","undefined","push"],"version":3,"file":"describedfield.js.map","sourceRoot":"../"}
1
+ {"mappings":"A,I,e,W,gB,C,E,c,C,E,c,e,iB,A,O,gB,A,C,c,S,C,E,G,K,gB,O,e,C,E,C,O,C,G,K,c,C,I,E,a,C,E,A,Q,a,C,E,C,I,E,C,G,E,Q,C,C,E,O,e,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,a,C,E,C,C,E,e,iB,C,e,I,e,c,Q,C,e,Q,S,C,C,C,ECMA,aACA,IAAI,EAAS,EAAwC,GAErD,SAAS,EAAwC,CAAa,EAC5D,OAAO,GAAiB,CAAC,CAC3B,CAMA,IAAI,EAAmB,EAAO,OAAO,CAAG,CAAC,CACzC,CAAA,EAAgB,yBAAyB,CAAG,EAmB5C,EAAgB,yBAAyB,CAAI,WAmL3C,SAAS,EAAkB,CAAK,CAAE,CAAY,EAC5C,MAAO,AAJA,AAAiB,UAAjB,OAIkB,GAJW,AAAU,OAIrB,GAJ6B,AAAU,KAIvC,EAAS,EAAQ,CAC5C,CAMA,OApLA,WAIE,I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,IAAI,CAAC,GAC/B,IAAI,CAAC,SAAS,CAAC,EAAU,CAAG,EAAE,EAI3B,EAAQ,EAAG,EAAQ,EAAgB,MAAM,CAAE,GAAS,EACvD,EAAiB,CAAe,CAAC,EAAM,CACvC,IAAI,CAAC,SAAS,CAAC,EAAU,CAAC,IAAI,CAAC,GAEjC,OAAO,IAAI,AACb,CACF,C,G,c","sources":["<anon>","src/js/describedfield.js"],"sourcesContent":["\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirec1f2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirec1f2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"aJuQy\", function(module, exports) {\n/**\n * @file Describes a data field of the restructured data.\n * @version {@link https://github.com/JohT/data-restructor-js/releases/latest latest version}\n * @author JohT\n * @version ${project.version}\n */ \"use strict\";\nvar $7d0608def849b52f$var$module = $7d0608def849b52f$var$describedFieldInternalCreateIfNotExists($7d0608def849b52f$var$module); // Fallback for vanilla js without modules\nfunction $7d0608def849b52f$var$describedFieldInternalCreateIfNotExists(objectToCheck) {\n return objectToCheck || {};\n}\n/**\n * Describes a data field of the restructured data.\n * @module described_field\n */ var $7d0608def849b52f$var$described_field = $7d0608def849b52f$var$module.exports = {}; // Export module for npm...\n$7d0608def849b52f$var$described_field.internalCreateIfNotExists = $7d0608def849b52f$var$describedFieldInternalCreateIfNotExists;\n/**\n * Describes a field of the restructured data.\n * Dynamically added properties represent custom named groups containing DescribedDataField-Arrays.\n *\n * @typedef {Object} module:described_field.DescribedDataField\n * @property {string} [category=\"\"] - name of the category. Could contain a short domain name like \"product\" or \"vendor\".\n * @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.\n * @property {string} [abbreviation=\"\"] - one optional character, a symbol character or a short abbreviation of the category\n * @property {string} [image=\"\"] - one optional path to an image resource\n * @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]\n * @property {string[]} groupNames - array of names of all dynamically added properties representing groups\n * @property {string} displayName - display name of the field\n * @property {string} fieldName - field name\n * @property {{*}} value - content of the field\n * @property {module:described_field.DescribedDataField[]} [couldBeAnyCustomGroupName] any number of groups attached to the field each containing multiple fields\n */ $7d0608def849b52f$var$described_field.DescribedDataFieldBuilder = function() {\n /**\n * Builds a {@link module:described_field.DescribedDataField}.\n * DescribedDataField is the main element of the restructured data and therefore considered \"public\".\n * @constructs DescribedDataFieldBuilder\n * @alias module:described_field.DescribedDataFieldBuilder\n */ function DescribedDataFieldBuilder() {\n /**\n * @type {module:described_field.DescribedDataField}\n */ this.describedField = {\n category: \"\",\n type: \"\",\n abbreviation: \"\",\n image: \"\",\n index: [],\n groupNames: [],\n displayName: \"\",\n fieldName: \"\",\n value: \"\"\n };\n /**\n * Takes over all values of the template {@link module:described_field.DescribedDataField}.\n * @function\n * @param {module:described_field.DescribedDataField} template\n * @returns {DescribedDataFieldBuilder}\n * @example fromDescribedDataField(sourceField)\n */ this.fromDescribedDataField = function(template) {\n this.category(template.category);\n this.type(template.type);\n this.abbreviation(template.abbreviation);\n this.image(template.image);\n this.index(template.index);\n this.groupNames(template.groupNames);\n this.displayName(template.displayName);\n this.fieldName(template.fieldName);\n this.value(template.value);\n return this;\n };\n /**\n * Sets the category.\n *\n * Contains a short domain nam, for example:\n * - \"product\" for products\n * - \"vendor\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example category(\"Product\")\n */ this.category = function(value) {\n this.describedField.category = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the type.\n *\n * Contains the type of the entry, for example:\n * - \"summary\" for e.g. a list overview.\n * - \"detail\" e.g. when a summary is selected.\n * - \"filter\" e.g. for field/value pair results that can be selected as search parameters.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example type(\"summary\")\n */ this.type = function(value) {\n this.describedField.type = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional abbreviation.\n *\n * Contains a symbol character or a very short abbreviation of the category.\n * - \"P\" for products\n * - \"V\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example abbreviation(\"P\")\n */ this.abbreviation = function(value) {\n this.describedField.abbreviation = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional path to an image resource.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example image(\"img/product.png\")\n */ this.image = function(value) {\n this.describedField.image = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the index as an array of numbers containing the splitted array indexes of the source field.\n * Example: \"responses[2].hits.hits[4]._source.name\" will have an index of [2,4].\n *\n * @function\n * @param {number[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example index([2,4])\n */ this.index = function(value) {\n this.describedField.index = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the group names as an array of strings containing the names of the dynamically added properties,\n * that contain an array of {@link module:described_field.DescribedDataField}-Objects.\n *\n * @function\n * @param {string[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example groupNames([\"summaries\",\"details\",\"options\"])\n */ this.groupNames = function(value) {\n this.describedField.groupNames = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the display name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example displayName(\"Color\")\n */ this.displayName = function(value) {\n this.describedField.displayName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the (technical) field name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example fieldName(\"color\")\n */ this.fieldName = function(value) {\n this.describedField.fieldName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the value/content of the field.\n *\n * @function\n * @param {*} value\n * @returns {DescribedDataFieldBuilder}\n * @example value(\"darkblue\")\n */ this.value = function(value) {\n this.describedField.value = value;\n return this;\n };\n /**\n * Finalizes the settings and builds the {@link module:described_field.DescribedDataField}.\n * @function\n * @returns {module:described_field.DescribedDataField}\n */ this.build = function() {\n return this.describedField;\n };\n }\n function isSpecifiedString(value) {\n return typeof value === \"string\" && value !== null && value !== \"\";\n }\n function withDefaultString(value, defaultValue) {\n return isSpecifiedString(value) ? value : defaultValue;\n }\n function withDefaultArray(value, defaultValue) {\n return value === undefined || value === null ? defaultValue : value;\n }\n return DescribedDataFieldBuilder;\n}();\n/**\n * Creates a new described data field with all properties of the original one except for dynamically added groups.\n * @param {module:described_field.DescribedDataField} describedDataField\n * @returns {module:described_field.DescribedDataField}\n * @memberof module:described_field\n */ $7d0608def849b52f$var$described_field.copyWithoutGroups = function(describedDataField) {\n return new $7d0608def849b52f$var$described_field.DescribedDataFieldBuilder().fromDescribedDataField(describedDataField).groupNames([]).build();\n};\n$7d0608def849b52f$var$described_field.DescribedDataFieldGroup = function() {\n /**\n * Adds groups to {@link module:described_field.DescribedDataField}s. These groups are dynamically added properties\n * that contain an array of sub fields of the same type {@link module:described_field.DescribedDataField}s.\n *\n * @param {module:described_field.DescribedDataField} dataField\n * @constructs DescribedDataFieldGroup\n * @alias module:described_field.DescribedDataFieldGroup\n * @example new described_field.DescribedDataFieldGroup(field).addGroupEntry(\"details\", detailField);\n */ function DescribedDataFieldGroup(dataField) {\n this.dataField = dataField;\n /**\n * Adds an entry to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entry will be added\n * @param {module:described_field.DescribedDataField} describedField sub field that is added to the group\n * @returns {DescribedDataFieldGroup}\n */ this.addGroupEntry = function(groupName, describedField) {\n this.addGroupEntries(groupName, [\n describedField\n ]);\n return this;\n };\n /**\n * Adds entries to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entries will be added\n * @param {module:described_field.DescribedDataField[]} describedFields sub fields that are added to the group\n * @returns {DescribedDataFieldGroup}\n */ this.addGroupEntries = function(groupName, describedFields) {\n if (!groupName || groupName.length === 0) return this;\n if (!describedFields || describedFields.length === 0) return this;\n if (this.dataField[groupName] === undefined) {\n this.dataField.groupNames.push(groupName);\n this.dataField[groupName] = [];\n }\n var index;\n var describedField;\n for(index = 0; index < describedFields.length; index += 1){\n describedField = describedFields[index];\n this.dataField[groupName].push(describedField);\n }\n return this;\n };\n }\n return DescribedDataFieldGroup;\n}();\n\n});\n\n\nparcelRequire(\"aJuQy\");\n\n//# sourceMappingURL=describedfield.js.map\n","/**\n * @file Describes a data field of the restructured data.\n * @version {@link https://github.com/JohT/data-restructor-js/releases/latest latest version}\n * @author JohT\n * @version ${project.version}\n */\n\"use strict\";\nvar module = describedFieldInternalCreateIfNotExists(module); // Fallback for vanilla js without modules\n\nfunction describedFieldInternalCreateIfNotExists(objectToCheck) {\n return objectToCheck || {};\n}\n\n/**\n * Describes a data field of the restructured data.\n * @module described_field\n */\nvar described_field = (module.exports = {}); // Export module for npm...\ndescribed_field.internalCreateIfNotExists = describedFieldInternalCreateIfNotExists;\n\n/**\n * Describes a field of the restructured data.\n * Dynamically added properties represent custom named groups containing DescribedDataField-Arrays.\n *\n * @typedef {Object} module:described_field.DescribedDataField\n * @property {string} [category=\"\"] - name of the category. Could contain a short domain name like \"product\" or \"vendor\".\n * @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.\n * @property {string} [abbreviation=\"\"] - one optional character, a symbol character or a short abbreviation of the category\n * @property {string} [image=\"\"] - one optional path to an image resource\n * @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]\n * @property {string[]} groupNames - array of names of all dynamically added properties representing groups\n * @property {string} displayName - display name of the field\n * @property {string} fieldName - field name\n * @property {{*}} value - content of the field\n * @property {module:described_field.DescribedDataField[]} [couldBeAnyCustomGroupName] any number of groups attached to the field each containing multiple fields\n */\n\ndescribed_field.DescribedDataFieldBuilder = (function () {\n /**\n * Builds a {@link module:described_field.DescribedDataField}.\n * DescribedDataField is the main element of the restructured data and therefore considered \"public\".\n * @constructs DescribedDataFieldBuilder\n * @alias module:described_field.DescribedDataFieldBuilder\n */\n function DescribedDataFieldBuilder() {\n /**\n * @type {module:described_field.DescribedDataField}\n */\n this.describedField = {\n category: \"\",\n type: \"\",\n abbreviation: \"\",\n image: \"\",\n index: [],\n groupNames: [],\n displayName: \"\",\n fieldName: \"\",\n value: \"\"\n };\n /**\n * Takes over all values of the template {@link module:described_field.DescribedDataField}.\n * @function\n * @param {module:described_field.DescribedDataField} template\n * @returns {DescribedDataFieldBuilder}\n * @example fromDescribedDataField(sourceField)\n */\n this.fromDescribedDataField = function (template) {\n this.category(template.category);\n this.type(template.type);\n this.abbreviation(template.abbreviation);\n this.image(template.image);\n this.index(template.index);\n this.groupNames(template.groupNames);\n this.displayName(template.displayName);\n this.fieldName(template.fieldName);\n this.value(template.value);\n return this;\n };\n /**\n * Sets the category.\n *\n * Contains a short domain nam, for example:\n * - \"product\" for products\n * - \"vendor\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example category(\"Product\")\n */\n this.category = function (value) {\n this.describedField.category = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the type.\n *\n * Contains the type of the entry, for example:\n * - \"summary\" for e.g. a list overview.\n * - \"detail\" e.g. when a summary is selected.\n * - \"filter\" e.g. for field/value pair results that can be selected as search parameters.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example type(\"summary\")\n */\n this.type = function (value) {\n this.describedField.type = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional abbreviation.\n *\n * Contains a symbol character or a very short abbreviation of the category.\n * - \"P\" for products\n * - \"V\" for vendors\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example abbreviation(\"P\")\n */\n this.abbreviation = function (value) {\n this.describedField.abbreviation = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the optional path to an image resource.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example image(\"img/product.png\")\n */\n this.image = function (value) {\n this.describedField.image = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the index as an array of numbers containing the splitted array indexes of the source field.\n * Example: \"responses[2].hits.hits[4]._source.name\" will have an index of [2,4].\n *\n * @function\n * @param {number[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example index([2,4])\n */\n this.index = function (value) {\n this.describedField.index = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the group names as an array of strings containing the names of the dynamically added properties,\n * that contain an array of {@link module:described_field.DescribedDataField}-Objects.\n *\n * @function\n * @param {string[]} [value=[]]\n * @returns {DescribedDataFieldBuilder}\n * @example groupNames([\"summaries\",\"details\",\"options\"])\n */\n this.groupNames = function (value) {\n this.describedField.groupNames = withDefaultArray(value, []);\n return this;\n };\n /**\n * Sets the display name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example displayName(\"Color\")\n */\n this.displayName = function (value) {\n this.describedField.displayName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the (technical) field name.\n *\n * @function\n * @param {String} [value=\"\"]\n * @returns {DescribedDataFieldBuilder}\n * @example fieldName(\"color\")\n */\n this.fieldName = function (value) {\n this.describedField.fieldName = withDefaultString(value, \"\");\n return this;\n };\n /**\n * Sets the value/content of the field.\n *\n * @function\n * @param {*} value\n * @returns {DescribedDataFieldBuilder}\n * @example value(\"darkblue\")\n */\n this.value = function (value) {\n this.describedField.value = value;\n return this;\n };\n\n /**\n * Finalizes the settings and builds the {@link module:described_field.DescribedDataField}.\n * @function\n * @returns {module:described_field.DescribedDataField}\n */\n this.build = function () {\n return this.describedField;\n };\n }\n\n function isSpecifiedString(value) {\n return typeof value === \"string\" && value !== null && value !== \"\";\n }\n\n function withDefaultString(value, defaultValue) {\n return isSpecifiedString(value) ? value : defaultValue;\n }\n\n function withDefaultArray(value, defaultValue) {\n return value === undefined || value === null ? defaultValue : value;\n }\n\n return DescribedDataFieldBuilder;\n}());\n\n/**\n * Creates a new described data field with all properties of the original one except for dynamically added groups.\n * @param {module:described_field.DescribedDataField} describedDataField\n * @returns {module:described_field.DescribedDataField}\n * @memberof module:described_field\n */\ndescribed_field.copyWithoutGroups = function (describedDataField) {\n return new described_field.DescribedDataFieldBuilder().fromDescribedDataField(describedDataField).groupNames([]).build();\n};\n\ndescribed_field.DescribedDataFieldGroup = (function () {\n /**\n * Adds groups to {@link module:described_field.DescribedDataField}s. These groups are dynamically added properties\n * that contain an array of sub fields of the same type {@link module:described_field.DescribedDataField}s.\n *\n * @param {module:described_field.DescribedDataField} dataField\n * @constructs DescribedDataFieldGroup\n * @alias module:described_field.DescribedDataFieldGroup\n * @example new described_field.DescribedDataFieldGroup(field).addGroupEntry(\"details\", detailField);\n */\n function DescribedDataFieldGroup(dataField) {\n this.dataField = dataField;\n\n /**\n * Adds an entry to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entry will be added\n * @param {module:described_field.DescribedDataField} describedField sub field that is added to the group\n * @returns {DescribedDataFieldGroup}\n */\n this.addGroupEntry = function (groupName, describedField) {\n this.addGroupEntries(groupName, [describedField]);\n return this;\n };\n\n /**\n * Adds entries to the given group. If the group does not exist, it will be created.\n * @function\n * @param {String} groupName name of the group to which the entries will be added\n * @param {module:described_field.DescribedDataField[]} describedFields sub fields that are added to the group\n * @returns {DescribedDataFieldGroup}\n */\n this.addGroupEntries = function (groupName, describedFields) {\n if (!groupName || groupName.length === 0) {\n return this;\n }\n if (!describedFields || describedFields.length === 0) {\n return this;\n }\n if (this.dataField[groupName] === undefined) {\n this.dataField.groupNames.push(groupName);\n this.dataField[groupName] = [];\n }\n var index;\n var describedField;\n for (index = 0; index < describedFields.length; index += 1) {\n describedField = describedFields[index];\n this.dataField[groupName].push(describedField);\n }\n return this;\n };\n }\n\n return DescribedDataFieldGroup;\n}());\n"],"names":["$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$7d0608def849b52f$var$module","$7d0608def849b52f$var$describedFieldInternalCreateIfNotExists","objectToCheck","$7d0608def849b52f$var$described_field","internalCreateIfNotExists","DescribedDataFieldBuilder","withDefaultString","value","defaultValue","isSpecifiedString","describedField","category","type","abbreviation","image","index","groupNames","displayName","fieldName","fromDescribedDataField","template","build","copyWithoutGroups","describedDataField","DescribedDataFieldGroup","dataField","addGroupEntry","groupName","addGroupEntries","describedFields","length","undefined","push"],"version":3,"file":"describedfield.js.map","sourceRoot":"../"}
@@ -1,2 +1,2 @@
1
- var e=globalThis,r={},t={},n=e.parcelRequirec1f2;null==n&&((n=function(e){if(e in r)return r[e].exports;if(e in t){var n=t[e];delete t[e];var o={id:e,exports:{}};return r[e]=o,n.call(o.exports,o,o.exports),o.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,r){t[e]=r},e.parcelRequirec1f2=n);var o=n.register;o("dED0n",function(e,r){if(!Array.prototype.indexOf){var t,n,o;Array.prototype.indexOf=(t=Object,n=Math.max,o=Math.min,function(e,r){if(this===null||void 0===this)throw TypeError("Array.prototype.indexOf called on null or undefined");var i=t(this),a=i.length>>>0,l=o(0|r,a);if(l<0)l=n(0,a+l);else if(l>=a)return -1;if(void 0===e){for(;l!==a;++l)if(void 0===i[l]&&l in i)return l}else if(e!=e){for(;l!==a;++l)if(i[l]!=i[l])return l}else for(;l!==a;++l)if(i[l]===e)return l;return -1})}}),o("b1M0n",function(e,r){Object.keys||(Object.keys=function(e){if(e!==Object(e))throw TypeError("Object.keys called on a non-object");var r,t=[];for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t})}),o("ds403",function(e,r){var t,o=i(o);function i(e){return e||{}}var a=o.exports={};a.internalCreateIfNotExists=i;var l=l||n("ccQZb");a.Resolver=(t=RegExp("\\[\\d+\\]","gi"),function(e){this.sourceDataObject=e,this.resolveTemplate=function(e){return this.replaceResolvableFields(e,function(e){var r,n,o,i,a=Object.keys(e);for(r=0;r<a.length;r+=1)i=e[n=a[r]],"fieldName"===(o=function(e){var r=e.lastIndexOf("."),n=e;r>0&&(n=e.substr(r+1));var o="";r>0&&(o=e.substr(0,r+1));var i=o.replace(t,"");return{group:o,groupWithoutArrayIndices:i,name:n}}(n)).name&&"fieldName"!==i&&(e[o.groupWithoutArrayIndices+i]=e[o.group+"value"]);return e}(this.resolvableFieldsOfAll(this.sourceDataObject)))},this.resolvableFieldsOfAll=function(){var e,r={},t=function(e){return 0!==e.indexOf("_")&&0>e.indexOf("._")};for(e=0;e<arguments.length;e+=1)(function(e,r,t){var n,o;for(n=0;n<e.length;n+=1)o=e[n],"function"==typeof t&&t(o.name)&&(r[o.name]=o.value)})(l.flattenToArray(arguments[e],3),r,t);return r},this.replaceResolvableFields=function(e,r){var t=e,n=Object.keys(r),o=0,i="",a="";for(o=0;o<n.length;o+=1)a=r[i=n[o]],t=t.replace("{{"+i+"}}",a);return t}})}),o("ccQZb",function(e,r){(($8e2fb4eb18d4597b$var$module||{}).exports={}).flattenToArray=function(e,r){var t=[];return("number"!=typeof r||r<1)&&(r=20),function e(n,o,i){if(!(i>r)&&"function"!=typeof n){if(Object(n)!==n)t.push({name:o,value:n});else if(Array.isArray(n)){var a,l=n.length;for(a=0;a<l;a+=1)e(n[a],o+"["+a+"]",i+1);0===l&&(t[o]=[],t.push({name:o,value:""}))}else{var f,u=!0;for(f in n)u=!1,e(n[f],o?o+"."+f:f,i+1);u&&o&&t.push({name:o,value:""})}}}(e,"",0),t}}),n("dED0n"),n("b1M0n");var i=n("ds403");module.exports={template_resolver:i};
1
+ var $parcel$global=globalThis,$parcel$modules={},$parcel$inits={},parcelRequire=$parcel$global.parcelRequirec1f2;null==parcelRequire&&((parcelRequire=function(e){if(e in $parcel$modules)return $parcel$modules[e].exports;if(e in $parcel$inits){var r=$parcel$inits[e];delete $parcel$inits[e];var t={id:e,exports:{}};return $parcel$modules[e]=t,r.call(t.exports,t,t.exports),t.exports}var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(e,r){$parcel$inits[e]=r},$parcel$global.parcelRequirec1f2=parcelRequire);"use strict";var parcelRegister=parcelRequire.register;parcelRegister("dED0n",function(e,r){var t,n,i;Array.prototype.indexOf||(Array.prototype.indexOf=(t=Object,n=Math.max,i=Math.min,function(e,r){if(this===null||void 0===this)throw TypeError("Array.prototype.indexOf called on null or undefined");var a=t(this),l=a.length>>>0,o=i(0|r,l);if(o<0)o=n(0,l+o);else if(o>=l)return -1;if(void 0===e){for(;o!==l;++o)if(void 0===a[o]&&o in a)return o}else if(e!=e){for(;o!==l;++o)if(a[o]!=a[o])return o}else for(;o!==l;++o)if(a[o]===e)return o;return -1}))}),parcelRegister("b1M0n",function(e,r){Object.keys||(Object.keys=function(e){if(e!==Object(e))throw TypeError("Object.keys called on a non-object");var r,t=[];for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t})}),parcelRegister("ds403",function(e,r){"use strict";var t,n=i(n);function i(e){return e||{}}var a=n.exports={};a.internalCreateIfNotExists=i;var l=l||parcelRequire("ccQZb");t=RegExp("\\[\\d+\\]","gi"),a.Resolver=function(e){this.sourceDataObject=e,this.resolveTemplate=function(e){return this.replaceResolvableFields(e,function(e){var r,n,i,a,l=Object.keys(e);for(r=0;r<l.length;r+=1)a=e[n=l[r]],"fieldName"===(i=function(e){var r=e.lastIndexOf("."),n=e;r>0&&(n=e.substr(r+1));var i="";r>0&&(i=e.substr(0,r+1));var a=i.replace(t,"");return{group:i,groupWithoutArrayIndices:a,name:n}}(n)).name&&"fieldName"!==a&&(e[i.groupWithoutArrayIndices+a]=e[i.group+"value"]);return e}(this.resolvableFieldsOfAll(this.sourceDataObject)))},this.resolvableFieldsOfAll=function(){var e,r={},t=function(e){return 0!==e.indexOf("_")&&0>e.indexOf("._")};for(e=0;e<arguments.length;e+=1)!function(e,r,t){var n,i;for(n=0;n<e.length;n+=1)i=e[n],"function"==typeof t&&t(i.name)&&(r[i.name]=i.value)}(l.flattenToArray(arguments[e],3),r,t);return r},this.replaceResolvableFields=function(e,r){var t=e,n=Object.keys(r),i=0,a="",l="";for(i=0;i<n.length;i+=1)l=r[a=n[i]],t=t.replace("{{"+a+"}}",l);return t}}}),parcelRegister("ccQZb",function(e,r){"use strict";var t=t||{};(t.exports={}).flattenToArray=function(e,r){var t=[];return("number"!=typeof r||r<1)&&(r=20),!function e(n,i,a){if(!(a>r)&&"function"!=typeof n)if(Object(n)!==n)t.push({name:i,value:n});else if(Array.isArray(n)){var l,o=n.length;for(l=0;l<o;l+=1)e(n[l],i+"["+l+"]",a+1);0===o&&(t[i]=[],t.push({name:i,value:""}))}else{var c,s=!0;for(c in n)s=!1,e(n[c],i?i+"."+c:c,a+1);s&&i&&t.push({name:i,value:""})}}(e,"",0),t}}),parcelRequire("dED0n"),parcelRequire("b1M0n");var $ds403=parcelRequire("ds403");module.exports={template_resolver:$ds403};
2
2
  //# sourceMappingURL=templateResolver-ie.js.map
@@ -1 +1 @@
1
- {"mappings":"A,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,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,CAAA,EAAoB,EADtB,EA+BA,AA5BA,SAAS,EAAQ,CAAG,CAAE,CAAI,CAAE,CAAK,EAC/B,GAAI,CAAA,CAAA,EAAQ,CAAA,GAAqB,AAAe,YAAf,OAAO,GAGxC,GAAI,OAAO,KAAS,EAClB,EAAO,IAAI,CAAC,CAAE,KAAM,EAAM,MAAO,CAAI,QAChC,GAAI,MAAM,OAAO,CAAC,GAAM,CAE7B,IADI,EACA,EAAI,EAAI,MAAM,CAClB,IAAK,EAAI,EAAG,EAAI,EAAG,GAAK,EACtB,EAAQ,CAAG,CAAC,EAAE,CAAE,EAAO,IAAM,EAAI,IAAK,EAAQ,EAEtC,CAAA,IAAN,IACF,CAAM,CAAC,EAAK,CAAG,EAAE,CACjB,EAAO,IAAI,CAAC,CAAE,KAAM,EAAM,MAAO,EAAG,GAExC,KAAO,CACL,IACI,EADA,EAAU,CAAA,EAEd,IAAK,KAAK,EACR,EAAU,CAAA,EACV,EAAQ,CAAG,CAAC,EAAE,CAAE,EAAO,EAAO,IAAM,EAAI,EAAG,EAAQ,GAEjD,GAAW,GACb,EAAO,IAAI,CAAC,CAAE,KAAM,EAAM,MAAO,EAAG,EAExC,EACF,EACQ,EAAM,GAAI,GACX,CACT,C,G,E,S,E,S,I,E,E,QCxDA,CAAA,OAAA,OAAA,CAAiB,CAAC,kBAAoB,CAAiB","sources":["<anon>","lib/js/polyfills/indexOfPolyfill.js","lib/js/polyfills/objectKeysPolyfill.js","src/js/templateResolver.js","lib/js/flattenToArray.js","src/js/templateResolver-ie.js"],"sourcesContent":["\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirec1f2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirec1f2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"dED0n\", function(module, exports) {\n//https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf#Polyfill\nif (!Array.prototype.indexOf) Array.prototype.indexOf = function(Object1, max, min) {\n \"use strict\";\n return function indexOf(member, fromIndex) {\n if (this === null || this === undefined) throw TypeError(\"Array.prototype.indexOf called on null or undefined\");\n var that = Object1(this), Len = that.length >>> 0, i = min(fromIndex | 0, Len);\n if (i < 0) i = max(0, Len + i);\n else if (i >= Len) return -1;\n if (member === void 0) {\n for(; i !== Len; ++i)if (that[i] === void 0 && i in that) return i; // undefined\n } else if (member !== member) {\n for(; i !== Len; ++i)if (that[i] !== that[i]) return i; // NaN\n } else for(; i !== Len; ++i)if (that[i] === member) return i; // all else\n return -1; // if the value was not found, then return -1\n };\n}(Object, Math.max, Math.min);\n\n});\n\nparcelRegister(\"b1M0n\", function(module, exports) {\n//http://tokenposts.blogspot.com/2012/04/javascript-objectkeys-browser.html\nif (!Object.keys) Object.keys = function(o) {\n if (o !== Object(o)) throw new TypeError(\"Object.keys called on a non-object\");\n var k = [], p;\n for(p in o)if (Object.prototype.hasOwnProperty.call(o, p)) k.push(p);\n return k;\n};\n\n});\n\nparcelRegister(\"ds403\", function(module, exports) {\n/**\n * @file Provides a simple template resolver, that replaces variables in double curly brackets with the values of a given object.\n * @version {@link https://github.com/JohT/data-restructor-js/releases/latest latest version}\n * @author JohT\n * @version ${project.version}\n */ \"use strict\";\nvar $9cb0fe3475961b60$var$module = $9cb0fe3475961b60$var$templateResolverInternalCreateIfNotExists($9cb0fe3475961b60$var$module); // Fallback for vanilla js without modules\nfunction $9cb0fe3475961b60$var$templateResolverInternalCreateIfNotExists(objectToCheck) {\n return objectToCheck || {};\n}\n/**\n * Provides a simple template resolver, that replaces variables in double curly brackets with the values of a given object.\n * @module template_resolver\n */ var $9cb0fe3475961b60$var$template_resolver = $9cb0fe3475961b60$var$module.exports = {}; // Export module for npm...\n$9cb0fe3475961b60$var$template_resolver.internalCreateIfNotExists = $9cb0fe3475961b60$var$templateResolverInternalCreateIfNotExists;\n\nvar $9cb0fe3475961b60$var$internal_object_tools = $9cb0fe3475961b60$var$internal_object_tools || (parcelRequire(\"ccQZb\")); // supports vanilla js & npm\n$9cb0fe3475961b60$var$template_resolver.Resolver = function() {\n var removeArrayBracketsRegEx = new RegExp(\"\\\\[\\\\d+\\\\]\", \"gi\");\n /**\n * Resolver. Is used inside this repository. It could also be used outside.\n * @param {*} sourceDataObject The properties of this object will be used to replace the placeholders in the template.\n * @constructs Resolver\n * @alias module:template_resolver.Resolver\n */ function Resolver(sourceDataObject) {\n /**\n * The properties of this source data object will be used to replace the placeholders in the template.\n */ this.sourceDataObject = sourceDataObject;\n /**\n * Resolves the given template.\n *\n * The template may contain variables in double curly brackets.\n * Supported variables are all properties of this object, e.g. \"{{fieldName}}\", \"{{displayName}}\", \"{{value}}\".\n * Since this object may also contains (described) groups of sub objects, they can also be used, e.g. \"{{summaries[0].value}}\"\n * Parts of the index can be inserted by using e.g. \"{{index[1]}}\".\n *\n * @param {string} template\n * @returns {string} resolved template\n */ this.resolveTemplate = function(template) {\n return this.replaceResolvableFields(template, addFieldsPerGroup(this.resolvableFieldsOfAll(this.sourceDataObject)));\n };\n /**\n * Returns a map like object, that contains all resolvable fields and their values as properties.\n * This function takes a variable count of input parameters,\n * each containing an object that contains resolvable fields to extract from.\n *\n * The recursion depth is limited to 3, so that an object,\n * that contains an object can contain another object (but not further).\n *\n * Properties beginning with an underscore in their name will be filtered out, since they are considered as internal fields.\n *\n * @param {...object} varArgs variable count of parameters. Each parameter contains an object that fields should be resolvable for variables.\n * @returns {object} object with resolvable field names and their values.\n * @public\n */ this.resolvableFieldsOfAll = function() {\n var map = {};\n var ignoreInternalFields = function(propertyName) {\n return propertyName.indexOf(\"_\") !== 0 && propertyName.indexOf(\"._\") < 0;\n };\n var index;\n for(index = 0; index < arguments.length; index += 1)addToFilteredMapObject($9cb0fe3475961b60$var$internal_object_tools.flattenToArray(arguments[index], 3), map, ignoreInternalFields);\n return map;\n };\n /**\n * Replaces all variables in double curly brackets, e.g. {{property}},\n * with the value of that property from the resolvableProperties.\n *\n * Supported property types: string, number, boolean\n * @param {string} stringContainingVariables\n * @param {object[]} resolvableFields (name=value)\n */ this.replaceResolvableFields = function(stringContainingVariables, resolvableFields) {\n var replaced = stringContainingVariables;\n var propertyNames = Object.keys(resolvableFields);\n var propertyIndex = 0;\n var propertyName = \"\";\n var propertyValue = \"\";\n for(propertyIndex = 0; propertyIndex < propertyNames.length; propertyIndex += 1){\n propertyName = propertyNames[propertyIndex];\n propertyValue = resolvableFields[propertyName];\n replaced = replaced.replace(\"{{\" + propertyName + \"}}\", propertyValue);\n }\n return replaced;\n };\n }\n /**\n * Adds the value of the \"fieldName\" property (including its group prefix) and its associated \"value\" property content.\n * For example: detail[2].fieldName=\"name\", detail[2].value=\"Smith\" lead to the additional property detail.name=\"Smith\".\n * @param {object} object with resolvable field names and their values.\n * @returns {object} object with resolvable field names and their values.\n * @protected\n * @memberof module:template_resolver.Resolver\n */ function addFieldsPerGroup(map) {\n var propertyNames = Object.keys(map);\n var i, fullPropertyName, propertyInfo, propertyValue;\n for(i = 0; i < propertyNames.length; i += 1){\n fullPropertyName = propertyNames[i];\n propertyValue = map[fullPropertyName];\n propertyInfo = getPropertyNameInfos(fullPropertyName);\n // Supports fields that are defined by a property named \"fieldName\" (containing the name)\n // and a property named \"value\" inside the same sub object (containing its value).\n // Ignore custom fields that are named \"fieldName\"(propertyValue), since this would lead to an unpredictable behavior.\n // TODO could make \"fieldName\" and \"value\" configurable\n if (propertyInfo.name === \"fieldName\" && propertyValue !== \"fieldName\") map[propertyInfo.groupWithoutArrayIndices + propertyValue] = map[propertyInfo.group + \"value\"];\n }\n return map;\n }\n /**\n * Infos about the full property name including the name of the group (followed by the separator) and the name of the property itself.\n * @param {String} fullPropertyName\n * @returns {Object} Contains \"group\" (empty or group name including trailing separator \".\"), \"groupWithoutArrayIndices\" and \"name\" (property name).\n * @protected\n * @memberof module:template_resolver.Resolver\n */ function getPropertyNameInfos(fullPropertyName) {\n var positionOfRightMostSeparator = fullPropertyName.lastIndexOf(\".\");\n var propertyName = fullPropertyName;\n if (positionOfRightMostSeparator > 0) propertyName = fullPropertyName.substr(positionOfRightMostSeparator + 1);\n var propertyGroup = \"\";\n if (positionOfRightMostSeparator > 0) propertyGroup = fullPropertyName.substr(0, positionOfRightMostSeparator + 1); //includes the trailing \".\".\n var propertyGroupWithoutArrayIndices = propertyGroup.replace(removeArrayBracketsRegEx, \"\");\n return {\n group: propertyGroup,\n groupWithoutArrayIndices: propertyGroupWithoutArrayIndices,\n name: propertyName\n };\n }\n /**\n * Collects all flattened name-value-pairs into one object using the property names as keys and their values as values (map-like).\n * Example: `{name: \"accountNumber\", value: \"12345\"}` becomes `mapObject[\"accountNumber\"]=\"12345\"`.\n *\n * @param {NameValuePair[]} elements flattened array of name-value-pairs\n * @param {object} mapObject container to collect the results. Needs to be created before e.g. using `{}`.\n * @param {function} filterMatchesFunction takes the property name as string argument and returns true (include) or false (exclude).\n * @protected\n * @memberof module:template_resolver.Resolver\n */ function addToFilteredMapObject(elements, mapObject, filterMatchesFunction) {\n var index, element;\n for(index = 0; index < elements.length; index += 1){\n element = elements[index];\n if (typeof filterMatchesFunction === \"function\" && filterMatchesFunction(element.name)) mapObject[element.name] = element.value;\n }\n return mapObject;\n }\n return Resolver;\n}();\n\n});\nparcelRegister(\"ccQZb\", function(module, exports) {\n\"use strict\";\n/**\n * @fileOverview Modded (compatibility, recursion depth) version of: https://stackoverflow.com/questions/19098797/fastest-way-to-flatten-un-flatten-nested-json-objectss\n * @version ${project.version}\n * @see {@link https://stackoverflow.com/questions/19098797/fastest-way-to-flatten-un-flatten-nested-json-objectss|stackoverflow flatten nested json objects}\n */ var $8e2fb4eb18d4597b$var$module = $8e2fb4eb18d4597b$var$module || {}; // Fallback for vanilla js without modules\n/**\n * internal_object_tools. Not meant to be used outside this repository.\n * @default {}\n */ var $8e2fb4eb18d4597b$var$internal_object_tools = $8e2fb4eb18d4597b$var$module.exports = {}; // Export module for npm...\n/**\n * @typedef {Object} NameValuePair\n * @property {string} name - point separated names of the flattened main and sub properties, e.g. \"responses[2].hits.hits[4]._source.name\".\n * @property {string} value - value of the property\n */ /**\n * @param {object} data hierarchical object that may consist fo fields, subfields and arrays.\n * @param {number} maxRecursionDepth\n * @returns {NameValuePair[]} array of property name and value pairs\n */ $8e2fb4eb18d4597b$var$internal_object_tools.flattenToArray = function(data, maxRecursionDepth) {\n var result = [];\n if (typeof maxRecursionDepth !== \"number\" || maxRecursionDepth < 1) maxRecursionDepth = 20;\n function recurse(cur, prop, depth) {\n if (depth > maxRecursionDepth || typeof cur === \"function\") return;\n if (Object(cur) !== cur) result.push({\n name: prop,\n value: cur\n });\n else if (Array.isArray(cur)) {\n var i;\n var l = cur.length;\n for(i = 0; i < l; i += 1)recurse(cur[i], prop + \"[\" + i + \"]\", depth + 1);\n if (l === 0) {\n result[prop] = [];\n result.push({\n name: prop,\n value: \"\"\n });\n }\n } else {\n var isEmpty = true;\n var p;\n for(p in cur){\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p, depth + 1);\n }\n if (isEmpty && prop) result.push({\n name: prop,\n value: \"\"\n });\n }\n }\n recurse(data, \"\", 0);\n return result;\n};\n\n});\n\n\n\"use strict\";\nparcelRequire(\"dED0n\");\nparcelRequire(\"b1M0n\");\n\nvar $ds403 = parcelRequire(\"ds403\");\nmodule.exports = {\n template_resolver: $ds403\n};\n\n\n//# sourceMappingURL=templateResolver-ie.js.map\n","//https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf#Polyfill\nif (!Array.prototype.indexOf) Array.prototype.indexOf = (function(Object, max, min){\n \"use strict\";\n return function indexOf(member, fromIndex) {\n if(this===null||this===undefined)throw TypeError(\"Array.prototype.indexOf called on null or undefined\");\n \n var that = Object(this), Len = that.length >>> 0, i = min(fromIndex | 0, Len);\n if (i < 0) i = max(0, Len+i); else if (i >= Len) return -1;\n \n if(member===void 0){ for(; i !== Len; ++i) if(that[i]===void 0 && i in that) return i; // undefined\n }else if(member !== member){ for(; i !== Len; ++i) if(that[i] !== that[i]) return i; // NaN\n }else for(; i !== Len; ++i) if(that[i] === member) return i; // all else\n \n return -1; // if the value was not found, then return -1\n };\n })(Object, Math.max, Math.min);","//http://tokenposts.blogspot.com/2012/04/javascript-objectkeys-browser.html\nif (!Object.keys) Object.keys = function(o) {\n if (o !== Object(o))\n throw new TypeError('Object.keys called on a non-object');\n var k=[],p;\n for (p in o) if (Object.prototype.hasOwnProperty.call(o,p)) k.push(p);\n return k;\n }","/**\n * @file Provides a simple template resolver, that replaces variables in double curly brackets with the values of a given object.\n * @version {@link https://github.com/JohT/data-restructor-js/releases/latest latest version}\n * @author JohT\n * @version ${project.version}\n */\n\"use strict\";\nvar module = templateResolverInternalCreateIfNotExists(module); // Fallback for vanilla js without modules\n\nfunction templateResolverInternalCreateIfNotExists(objectToCheck) {\n return objectToCheck || {};\n}\n\n/**\n * Provides a simple template resolver, that replaces variables in double curly brackets with the values of a given object.\n * @module template_resolver\n */\nvar template_resolver = (module.exports = {}); // Export module for npm...\ntemplate_resolver.internalCreateIfNotExists = templateResolverInternalCreateIfNotExists;\n\nvar internal_object_tools = internal_object_tools || require(\"../../lib/js/flattenToArray\"); // supports vanilla js & npm\n\ntemplate_resolver.Resolver = (function () {\n var removeArrayBracketsRegEx = new RegExp(\"\\\\[\\\\d+\\\\]\", \"gi\");\n\n /**\n * Resolver. Is used inside this repository. It could also be used outside.\n * @param {*} sourceDataObject The properties of this object will be used to replace the placeholders in the template.\n * @constructs Resolver\n * @alias module:template_resolver.Resolver\n */\n function Resolver(sourceDataObject) {\n /**\n * The properties of this source data object will be used to replace the placeholders in the template.\n */\n this.sourceDataObject = sourceDataObject;\n /**\n * Resolves the given template.\n *\n * The template may contain variables in double curly brackets.\n * Supported variables are all properties of this object, e.g. \"{{fieldName}}\", \"{{displayName}}\", \"{{value}}\".\n * Since this object may also contains (described) groups of sub objects, they can also be used, e.g. \"{{summaries[0].value}}\"\n * Parts of the index can be inserted by using e.g. \"{{index[1]}}\".\n *\n * @param {string} template\n * @returns {string} resolved template\n */\n this.resolveTemplate = function (template) {\n return this.replaceResolvableFields(template, addFieldsPerGroup(this.resolvableFieldsOfAll(this.sourceDataObject)));\n };\n /**\n * Returns a map like object, that contains all resolvable fields and their values as properties.\n * This function takes a variable count of input parameters,\n * each containing an object that contains resolvable fields to extract from.\n *\n * The recursion depth is limited to 3, so that an object,\n * that contains an object can contain another object (but not further).\n *\n * Properties beginning with an underscore in their name will be filtered out, since they are considered as internal fields.\n *\n * @param {...object} varArgs variable count of parameters. Each parameter contains an object that fields should be resolvable for variables.\n * @returns {object} object with resolvable field names and their values.\n * @public\n */\n this.resolvableFieldsOfAll = function () {\n var map = {};\n var ignoreInternalFields = function (propertyName) {\n return propertyName.indexOf(\"_\") !== 0 && propertyName.indexOf(\"._\") < 0;\n };\n var index;\n for (index = 0; index < arguments.length; index += 1) {\n addToFilteredMapObject(internal_object_tools.flattenToArray(arguments[index], 3), map, ignoreInternalFields);\n }\n return map;\n };\n /**\n * Replaces all variables in double curly brackets, e.g. {{property}},\n * with the value of that property from the resolvableProperties.\n *\n * Supported property types: string, number, boolean\n * @param {string} stringContainingVariables\n * @param {object[]} resolvableFields (name=value)\n */\n this.replaceResolvableFields = function (stringContainingVariables, resolvableFields) {\n var replaced = stringContainingVariables;\n var propertyNames = Object.keys(resolvableFields);\n var propertyIndex = 0;\n var propertyName = \"\";\n var propertyValue = \"\";\n for (propertyIndex = 0; propertyIndex < propertyNames.length; propertyIndex += 1) {\n propertyName = propertyNames[propertyIndex];\n propertyValue = resolvableFields[propertyName];\n replaced = replaced.replace(\"{{\" + propertyName + \"}}\", propertyValue);\n }\n return replaced;\n };\n }\n\n /**\n * Adds the value of the \"fieldName\" property (including its group prefix) and its associated \"value\" property content.\n * For example: detail[2].fieldName=\"name\", detail[2].value=\"Smith\" lead to the additional property detail.name=\"Smith\".\n * @param {object} object with resolvable field names and their values.\n * @returns {object} object with resolvable field names and their values.\n * @protected\n * @memberof module:template_resolver.Resolver\n */\n function addFieldsPerGroup(map) {\n var propertyNames = Object.keys(map);\n var i, fullPropertyName, propertyInfo, propertyValue;\n for (i = 0; i < propertyNames.length; i += 1) {\n fullPropertyName = propertyNames[i];\n propertyValue = map[fullPropertyName];\n propertyInfo = getPropertyNameInfos(fullPropertyName);\n // Supports fields that are defined by a property named \"fieldName\" (containing the name)\n // and a property named \"value\" inside the same sub object (containing its value).\n // Ignore custom fields that are named \"fieldName\"(propertyValue), since this would lead to an unpredictable behavior.\n // TODO could make \"fieldName\" and \"value\" configurable\n if (propertyInfo.name === \"fieldName\" && propertyValue !== \"fieldName\") {\n map[propertyInfo.groupWithoutArrayIndices + propertyValue] = map[propertyInfo.group + \"value\"];\n }\n }\n return map;\n }\n\n /**\n * Infos about the full property name including the name of the group (followed by the separator) and the name of the property itself.\n * @param {String} fullPropertyName\n * @returns {Object} Contains \"group\" (empty or group name including trailing separator \".\"), \"groupWithoutArrayIndices\" and \"name\" (property name).\n * @protected\n * @memberof module:template_resolver.Resolver\n */\n function getPropertyNameInfos(fullPropertyName) {\n var positionOfRightMostSeparator = fullPropertyName.lastIndexOf(\".\");\n var propertyName = fullPropertyName;\n if (positionOfRightMostSeparator > 0) {\n propertyName = fullPropertyName.substr(positionOfRightMostSeparator + 1);\n }\n var propertyGroup = \"\";\n if (positionOfRightMostSeparator > 0) {\n propertyGroup = fullPropertyName.substr(0, positionOfRightMostSeparator + 1); //includes the trailing \".\".\n }\n var propertyGroupWithoutArrayIndices = propertyGroup.replace(removeArrayBracketsRegEx, \"\");\n return { group: propertyGroup, groupWithoutArrayIndices: propertyGroupWithoutArrayIndices, name: propertyName };\n }\n\n /**\n * Collects all flattened name-value-pairs into one object using the property names as keys and their values as values (map-like).\n * Example: `{name: \"accountNumber\", value: \"12345\"}` becomes `mapObject[\"accountNumber\"]=\"12345\"`.\n *\n * @param {NameValuePair[]} elements flattened array of name-value-pairs\n * @param {object} mapObject container to collect the results. Needs to be created before e.g. using `{}`.\n * @param {function} filterMatchesFunction takes the property name as string argument and returns true (include) or false (exclude).\n * @protected\n * @memberof module:template_resolver.Resolver\n */\n function addToFilteredMapObject(elements, mapObject, filterMatchesFunction) {\n var index, element;\n for (index = 0; index < elements.length; index += 1) {\n element = elements[index];\n if (typeof filterMatchesFunction === \"function\" && filterMatchesFunction(element.name)) {\n mapObject[element.name] = element.value;\n }\n }\n return mapObject;\n }\n\n return Resolver;\n}());\n","\"use strict\";\n/**\n * @fileOverview Modded (compatibility, recursion depth) version of: https://stackoverflow.com/questions/19098797/fastest-way-to-flatten-un-flatten-nested-json-objectss\n * @version ${project.version}\n * @see {@link https://stackoverflow.com/questions/19098797/fastest-way-to-flatten-un-flatten-nested-json-objectss|stackoverflow flatten nested json objects}\n */\nvar module = module || {}; // Fallback for vanilla js without modules\n\n/**\n * internal_object_tools. Not meant to be used outside this repository.\n * @default {}\n */\nvar internal_object_tools = module.exports={}; // Export module for npm...\n\n/**\n * @typedef {Object} NameValuePair\n * @property {string} name - point separated names of the flattened main and sub properties, e.g. \"responses[2].hits.hits[4]._source.name\".\n * @property {string} value - value of the property\n */\n\n/**\n * @param {object} data hierarchical object that may consist fo fields, subfields and arrays.\n * @param {number} maxRecursionDepth\n * @returns {NameValuePair[]} array of property name and value pairs\n */\ninternal_object_tools.flattenToArray = function (data, maxRecursionDepth) {\n var result = [];\n if (typeof maxRecursionDepth !== \"number\" || maxRecursionDepth < 1) {\n maxRecursionDepth = 20;\n }\n function recurse(cur, prop, depth) {\n if (depth > maxRecursionDepth || typeof cur === \"function\") {\n return;\n }\n if (Object(cur) !== cur) {\n result.push({ name: prop, value: cur });\n } else if (Array.isArray(cur)) {\n var i;\n var l = cur.length;\n for (i = 0; i < l; i += 1) {\n recurse(cur[i], prop + \"[\" + i + \"]\", depth + 1);\n }\n if (l === 0) {\n result[prop] = [];\n result.push({ name: prop, value: \"\" });\n }\n } else {\n var isEmpty = true;\n var p;\n for (p in cur) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p, depth + 1);\n }\n if (isEmpty && prop) {\n result.push({ name: prop, value: \"\" });\n }\n }\n }\n recurse(data, \"\", 0);\n return result;\n};\n","\"use strict\";\nrequire(\"../../lib/js/polyfills/indexOfPolyfill.js\");\nrequire(\"../../lib/js/polyfills/objectKeysPolyfill.js\");\nvar template_resolver = require(\"../../src/js/templateResolver.js\");\nmodule.exports = {template_resolver : template_resolver};\n"],"names":["$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","Array","prototype","indexOf","Object1","max","min","Object","Math","member","fromIndex","undefined","TypeError","that","Len","length","i","keys","o","p","k","hasOwnProperty","push","removeArrayBracketsRegEx","$9cb0fe3475961b60$var$module","$9cb0fe3475961b60$var$templateResolverInternalCreateIfNotExists","objectToCheck","$9cb0fe3475961b60$var$template_resolver","internalCreateIfNotExists","$9cb0fe3475961b60$var$internal_object_tools","Resolver","RegExp","sourceDataObject","resolveTemplate","template","replaceResolvableFields","addFieldsPerGroup","map","fullPropertyName","propertyInfo","propertyValue","propertyNames","getPropertyNameInfos","positionOfRightMostSeparator","lastIndexOf","propertyName","substr","propertyGroup","propertyGroupWithoutArrayIndices","replace","group","groupWithoutArrayIndices","name","resolvableFieldsOfAll","index","ignoreInternalFields","arguments","addToFilteredMapObject","elements","mapObject","filterMatchesFunction","element","value","flattenToArray","stringContainingVariables","resolvableFields","replaced","propertyIndex","$8e2fb4eb18d4597b$var$internal_object_tools","$8e2fb4eb18d4597b$var$module","data","maxRecursionDepth","result","recurse","cur","prop","depth","isArray","l","isEmpty","$ds403","template_resolver"],"version":3,"file":"templateResolver-ie.js.map","sourceRoot":"../"}
1
+ {"mappings":"A,I,e,W,gB,C,E,c,C,E,c,e,iB,A,O,gB,A,C,c,S,C,E,G,K,gB,O,e,C,E,C,O,C,G,K,c,C,I,E,a,C,E,A,Q,a,C,E,C,I,E,C,G,E,Q,C,C,E,O,e,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,a,C,E,C,C,E,e,iB,C,cKAA,CAAA,a,I,e,c,Q,C,e,Q,S,C,C,C,MJCmE,EAAQ,EAAK,CAA5E,AAAC,CAAA,MAAM,SAAS,CAAC,OAAO,EAAG,CAAA,MAAM,SAAS,CAAC,OAAO,EAAa,EAc9D,OAdsE,EAc9D,KAAK,GAAG,CAd2D,EAczD,KAAK,GAAG,CAZpB,SAAiB,CAAM,CAAE,CAAS,EACvC,GAAG,IAAI,GAAG,MAAM,AAAO,KAAA,IAAP,IAAI,CAAa,MAAM,UAAU,uDAEjD,IAAI,EAAO,EAAO,IAAI,EAAG,EAAM,EAAK,MAAM,GAAK,EAAG,EAAI,EAAI,AAAY,EAAZ,EAAe,GACzE,GAAI,EAAI,EAAG,EAAI,EAAI,EAAG,EAAI,QAAS,GAAI,GAAK,EAAK,OAAO,GAExD,GAAG,AAAS,KAAK,IAAd,EAAkB,CAAA,KAAM,IAAM,EAAK,EAAE,EAAG,GAAG,AAAU,KAAK,IAAf,CAAI,CAAC,EAAE,EAAa,KAAK,EAAM,OAAO,CAAA,MAC9E,GAAG,GAAW,EAAW,CAAA,KAAM,IAAM,EAAK,EAAE,EAAG,GAAG,CAAI,CAAC,EAAE,EAAK,CAAI,CAAC,EAAE,CAAE,OAAO,CAAA,MACpD,KAAM,IAAM,EAAK,EAAE,EAAG,GAAG,CAAI,CAAC,EA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AC,KAAO,EAAe,KAAM,GAE1D,OAAO,CACT,CACF,C,G,e,Q,S,C,C,C,EChGF,aAMA,IAAI,EAAS,GAAU,CAAC,CAmBxB,CAb4B,CAAA,EAAO,OAAO,CAAC,CAAC,CAAA,EAatB,cAAc,CAAG,SAAU,CAAI,CAAE,CAAiB,EACtE,IAAI,EAAS,EAAE,OACX,CAAA,AAA6B,UAA7B,OAAO,GAAkC,EAAoB,CAAA,GAC/D,CAAA,EAAoB,EADtB,GA+BA,AA5BA,SAAS,EAAQ,CAAG,CAAE,CAAI,CAAE,CAAK,EAC/B,GAAI,CAAA,CAAA,EAAQ,CAAA,GAAqB,AAAe,YAAf,OAAO,EAGxC,GAAI,OAAO,KAAS,EAClB,EAAO,IAAI,CAAC,CAAE,KAAM,EAAM,MAAO,CAAI,QAChC,GAAI,MAAM,OAAO,CAAC,GAAM,CAE7B,IADI,EACA,EAAI,EAAI,MAAM,CAClB,IAAK,EAAI,EAAG,EAAI,EAAG,GAAK,EACtB,EAAQ,CAAG,CAAC,EAAE,CAAE,EAAO,IAAM,EAAI,IAAK,EAAQ,EAEtC,CAAA,IAAN,IACF,CAAM,CAAC,EAAK,CAAG,EAAE,CACjB,EAAO,IAAI,CAAC,CAAE,KAAM,EAAM,MAAO,EAAG,GAExC,KAAO,CACL,IACI,EADA,EAAU,CAAA,EAEd,IAAK,KAAK,EACR,EAAU,CAAA,EACV,EAAQ,CAAG,CAAC,EAAE,CAAE,EAAO,EAAO,IAAM,EAAI,EAAG,EAAQ,EAEjD,CAAA,GAAW,GACb,EAAO,IAAI,CAAC,CAAE,KAAM,EAAM,MAAO,EAAG,EAExC,CACF,EACQ,EAAM,GAAI,GACX,CACT,C,G,c,S,c,S,I,O,c,QCxDA,CAAA,OAAA,OAAA,CAAiB,CAAC,kBAAoB,MAAiB","sources":["<anon>","lib/js/polyfills/indexOfPolyfill.js","lib/js/polyfills/objectKeysPolyfill.js","src/js/templateResolver.js","lib/js/flattenToArray.js","src/js/templateResolver-ie.js"],"sourcesContent":["\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirec1f2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirec1f2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"dED0n\", function(module, exports) {\n//https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf#Polyfill\nif (!Array.prototype.indexOf) Array.prototype.indexOf = function(Object1, max, min) {\n \"use strict\";\n return function indexOf(member, fromIndex) {\n if (this === null || this === undefined) throw TypeError(\"Array.prototype.indexOf called on null or undefined\");\n var that = Object1(this), Len = that.length >>> 0, i = min(fromIndex | 0, Len);\n if (i < 0) i = max(0, Len + i);\n else if (i >= Len) return -1;\n if (member === void 0) {\n for(; i !== Len; ++i)if (that[i] === void 0 && i in that) return i; // undefined\n } else if (member !== member) {\n for(; i !== Len; ++i)if (that[i] !== that[i]) return i; // NaN\n } else for(; i !== Len; ++i)if (that[i] === member) return i; // all else\n return -1; // if the value was not found, then return -1\n };\n}(Object, Math.max, Math.min);\n\n});\n\nparcelRegister(\"b1M0n\", function(module, exports) {\n//http://tokenposts.blogspot.com/2012/04/javascript-objectkeys-browser.html\nif (!Object.keys) Object.keys = function(o) {\n if (o !== Object(o)) throw new TypeError('Object.keys called on a non-object');\n var k = [], p;\n for(p in o)if (Object.prototype.hasOwnProperty.call(o, p)) k.push(p);\n return k;\n};\n\n});\n\nparcelRegister(\"ds403\", function(module, exports) {\n/**\n * @file Provides a simple template resolver, that replaces variables in double curly brackets with the values of a given object.\n * @version {@link https://github.com/JohT/data-restructor-js/releases/latest latest version}\n * @author JohT\n * @version ${project.version}\n */ \"use strict\";\nvar $9cb0fe3475961b60$var$module = $9cb0fe3475961b60$var$templateResolverInternalCreateIfNotExists($9cb0fe3475961b60$var$module); // Fallback for vanilla js without modules\nfunction $9cb0fe3475961b60$var$templateResolverInternalCreateIfNotExists(objectToCheck) {\n return objectToCheck || {};\n}\n/**\n * Provides a simple template resolver, that replaces variables in double curly brackets with the values of a given object.\n * @module template_resolver\n */ var $9cb0fe3475961b60$var$template_resolver = $9cb0fe3475961b60$var$module.exports = {}; // Export module for npm...\n$9cb0fe3475961b60$var$template_resolver.internalCreateIfNotExists = $9cb0fe3475961b60$var$templateResolverInternalCreateIfNotExists;\n\nvar $9cb0fe3475961b60$var$internal_object_tools = $9cb0fe3475961b60$var$internal_object_tools || (parcelRequire(\"ccQZb\")); // supports vanilla js & npm\n$9cb0fe3475961b60$var$template_resolver.Resolver = function() {\n var removeArrayBracketsRegEx = new RegExp(\"\\\\[\\\\d+\\\\]\", \"gi\");\n /**\n * Resolver. Is used inside this repository. It could also be used outside.\n * @param {*} sourceDataObject The properties of this object will be used to replace the placeholders in the template.\n * @constructs Resolver\n * @alias module:template_resolver.Resolver\n */ function Resolver(sourceDataObject) {\n /**\n * The properties of this source data object will be used to replace the placeholders in the template.\n */ this.sourceDataObject = sourceDataObject;\n /**\n * Resolves the given template.\n *\n * The template may contain variables in double curly brackets.\n * Supported variables are all properties of this object, e.g. \"{{fieldName}}\", \"{{displayName}}\", \"{{value}}\".\n * Since this object may also contains (described) groups of sub objects, they can also be used, e.g. \"{{summaries[0].value}}\"\n * Parts of the index can be inserted by using e.g. \"{{index[1]}}\".\n *\n * @param {string} template\n * @returns {string} resolved template\n */ this.resolveTemplate = function(template) {\n return this.replaceResolvableFields(template, addFieldsPerGroup(this.resolvableFieldsOfAll(this.sourceDataObject)));\n };\n /**\n * Returns a map like object, that contains all resolvable fields and their values as properties.\n * This function takes a variable count of input parameters,\n * each containing an object that contains resolvable fields to extract from.\n *\n * The recursion depth is limited to 3, so that an object,\n * that contains an object can contain another object (but not further).\n *\n * Properties beginning with an underscore in their name will be filtered out, since they are considered as internal fields.\n *\n * @param {...object} varArgs variable count of parameters. Each parameter contains an object that fields should be resolvable for variables.\n * @returns {object} object with resolvable field names and their values.\n * @public\n */ this.resolvableFieldsOfAll = function() {\n var map = {};\n var ignoreInternalFields = function(propertyName) {\n return propertyName.indexOf(\"_\") !== 0 && propertyName.indexOf(\"._\") < 0;\n };\n var index;\n for(index = 0; index < arguments.length; index += 1)addToFilteredMapObject($9cb0fe3475961b60$var$internal_object_tools.flattenToArray(arguments[index], 3), map, ignoreInternalFields);\n return map;\n };\n /**\n * Replaces all variables in double curly brackets, e.g. {{property}},\n * with the value of that property from the resolvableProperties.\n *\n * Supported property types: string, number, boolean\n * @param {string} stringContainingVariables\n * @param {object[]} resolvableFields (name=value)\n */ this.replaceResolvableFields = function(stringContainingVariables, resolvableFields) {\n var replaced = stringContainingVariables;\n var propertyNames = Object.keys(resolvableFields);\n var propertyIndex = 0;\n var propertyName = \"\";\n var propertyValue = \"\";\n for(propertyIndex = 0; propertyIndex < propertyNames.length; propertyIndex += 1){\n propertyName = propertyNames[propertyIndex];\n propertyValue = resolvableFields[propertyName];\n replaced = replaced.replace(\"{{\" + propertyName + \"}}\", propertyValue);\n }\n return replaced;\n };\n }\n /**\n * Adds the value of the \"fieldName\" property (including its group prefix) and its associated \"value\" property content.\n * For example: detail[2].fieldName=\"name\", detail[2].value=\"Smith\" lead to the additional property detail.name=\"Smith\".\n * @param {object} object with resolvable field names and their values.\n * @returns {object} object with resolvable field names and their values.\n * @protected\n * @memberof module:template_resolver.Resolver\n */ function addFieldsPerGroup(map) {\n var propertyNames = Object.keys(map);\n var i, fullPropertyName, propertyInfo, propertyValue;\n for(i = 0; i < propertyNames.length; i += 1){\n fullPropertyName = propertyNames[i];\n propertyValue = map[fullPropertyName];\n propertyInfo = getPropertyNameInfos(fullPropertyName);\n // Supports fields that are defined by a property named \"fieldName\" (containing the name)\n // and a property named \"value\" inside the same sub object (containing its value).\n // Ignore custom fields that are named \"fieldName\"(propertyValue), since this would lead to an unpredictable behavior.\n // TODO could make \"fieldName\" and \"value\" configurable\n if (propertyInfo.name === \"fieldName\" && propertyValue !== \"fieldName\") map[propertyInfo.groupWithoutArrayIndices + propertyValue] = map[propertyInfo.group + \"value\"];\n }\n return map;\n }\n /**\n * Infos about the full property name including the name of the group (followed by the separator) and the name of the property itself.\n * @param {String} fullPropertyName\n * @returns {Object} Contains \"group\" (empty or group name including trailing separator \".\"), \"groupWithoutArrayIndices\" and \"name\" (property name).\n * @protected\n * @memberof module:template_resolver.Resolver\n */ function getPropertyNameInfos(fullPropertyName) {\n var positionOfRightMostSeparator = fullPropertyName.lastIndexOf(\".\");\n var propertyName = fullPropertyName;\n if (positionOfRightMostSeparator > 0) propertyName = fullPropertyName.substr(positionOfRightMostSeparator + 1);\n var propertyGroup = \"\";\n if (positionOfRightMostSeparator > 0) propertyGroup = fullPropertyName.substr(0, positionOfRightMostSeparator + 1); //includes the trailing \".\".\n var propertyGroupWithoutArrayIndices = propertyGroup.replace(removeArrayBracketsRegEx, \"\");\n return {\n group: propertyGroup,\n groupWithoutArrayIndices: propertyGroupWithoutArrayIndices,\n name: propertyName\n };\n }\n /**\n * Collects all flattened name-value-pairs into one object using the property names as keys and their values as values (map-like).\n * Example: `{name: \"accountNumber\", value: \"12345\"}` becomes `mapObject[\"accountNumber\"]=\"12345\"`.\n *\n * @param {NameValuePair[]} elements flattened array of name-value-pairs\n * @param {object} mapObject container to collect the results. Needs to be created before e.g. using `{}`.\n * @param {function} filterMatchesFunction takes the property name as string argument and returns true (include) or false (exclude).\n * @protected\n * @memberof module:template_resolver.Resolver\n */ function addToFilteredMapObject(elements, mapObject, filterMatchesFunction) {\n var index, element;\n for(index = 0; index < elements.length; index += 1){\n element = elements[index];\n if (typeof filterMatchesFunction === \"function\" && filterMatchesFunction(element.name)) mapObject[element.name] = element.value;\n }\n return mapObject;\n }\n return Resolver;\n}();\n\n});\nparcelRegister(\"ccQZb\", function(module, exports) {\n\"use strict\";\n/**\n * @fileOverview Modded (compatibility, recursion depth) version of: https://stackoverflow.com/questions/19098797/fastest-way-to-flatten-un-flatten-nested-json-objectss\n * @version ${project.version}\n * @see {@link https://stackoverflow.com/questions/19098797/fastest-way-to-flatten-un-flatten-nested-json-objectss|stackoverflow flatten nested json objects}\n */ var $8e2fb4eb18d4597b$var$module = $8e2fb4eb18d4597b$var$module || {}; // Fallback for vanilla js without modules\n/**\n * internal_object_tools. Not meant to be used outside this repository.\n * @default {}\n */ var $8e2fb4eb18d4597b$var$internal_object_tools = $8e2fb4eb18d4597b$var$module.exports = {}; // Export module for npm...\n/**\n * @typedef {Object} NameValuePair\n * @property {string} name - point separated names of the flattened main and sub properties, e.g. \"responses[2].hits.hits[4]._source.name\".\n * @property {string} value - value of the property\n */ /**\n * @param {object} data hierarchical object that may consist fo fields, subfields and arrays.\n * @param {number} maxRecursionDepth\n * @returns {NameValuePair[]} array of property name and value pairs\n */ $8e2fb4eb18d4597b$var$internal_object_tools.flattenToArray = function(data, maxRecursionDepth) {\n var result = [];\n if (typeof maxRecursionDepth !== \"number\" || maxRecursionDepth < 1) maxRecursionDepth = 20;\n function recurse(cur, prop, depth) {\n if (depth > maxRecursionDepth || typeof cur === \"function\") return;\n if (Object(cur) !== cur) result.push({\n name: prop,\n value: cur\n });\n else if (Array.isArray(cur)) {\n var i;\n var l = cur.length;\n for(i = 0; i < l; i += 1)recurse(cur[i], prop + \"[\" + i + \"]\", depth + 1);\n if (l === 0) {\n result[prop] = [];\n result.push({\n name: prop,\n value: \"\"\n });\n }\n } else {\n var isEmpty = true;\n var p;\n for(p in cur){\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p, depth + 1);\n }\n if (isEmpty && prop) result.push({\n name: prop,\n value: \"\"\n });\n }\n }\n recurse(data, \"\", 0);\n return result;\n};\n\n});\n\n\n\"use strict\";\nparcelRequire(\"dED0n\");\nparcelRequire(\"b1M0n\");\n\nvar $ds403 = parcelRequire(\"ds403\");\nmodule.exports = {\n template_resolver: $ds403\n};\n\n\n//# sourceMappingURL=templateResolver-ie.js.map\n","//https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf#Polyfill\nif (!Array.prototype.indexOf) Array.prototype.indexOf = (function(Object, max, min){\n \"use strict\";\n return function indexOf(member, fromIndex) {\n if(this===null||this===undefined)throw TypeError(\"Array.prototype.indexOf called on null or undefined\");\n \n var that = Object(this), Len = that.length >>> 0, i = min(fromIndex | 0, Len);\n if (i < 0) i = max(0, Len+i); else if (i >= Len) return -1;\n \n if(member===void 0){ for(; i !== Len; ++i) if(that[i]===void 0 && i in that) return i; // undefined\n }else if(member !== member){ for(; i !== Len; ++i) if(that[i] !== that[i]) return i; // NaN\n }else for(; i !== Len; ++i) if(that[i] === member) return i; // all else\n \n return -1; // if the value was not found, then return -1\n };\n })(Object, Math.max, Math.min);","//http://tokenposts.blogspot.com/2012/04/javascript-objectkeys-browser.html\nif (!Object.keys) Object.keys = function(o) {\n if (o !== Object(o))\n throw new TypeError('Object.keys called on a non-object');\n var k=[],p;\n for (p in o) if (Object.prototype.hasOwnProperty.call(o,p)) k.push(p);\n return k;\n }","/**\n * @file Provides a simple template resolver, that replaces variables in double curly brackets with the values of a given object.\n * @version {@link https://github.com/JohT/data-restructor-js/releases/latest latest version}\n * @author JohT\n * @version ${project.version}\n */\n\"use strict\";\nvar module = templateResolverInternalCreateIfNotExists(module); // Fallback for vanilla js without modules\n\nfunction templateResolverInternalCreateIfNotExists(objectToCheck) {\n return objectToCheck || {};\n}\n\n/**\n * Provides a simple template resolver, that replaces variables in double curly brackets with the values of a given object.\n * @module template_resolver\n */\nvar template_resolver = (module.exports = {}); // Export module for npm...\ntemplate_resolver.internalCreateIfNotExists = templateResolverInternalCreateIfNotExists;\n\nvar internal_object_tools = internal_object_tools || require(\"../../lib/js/flattenToArray\"); // supports vanilla js & npm\n\ntemplate_resolver.Resolver = (function () {\n var removeArrayBracketsRegEx = new RegExp(\"\\\\[\\\\d+\\\\]\", \"gi\");\n\n /**\n * Resolver. Is used inside this repository. It could also be used outside.\n * @param {*} sourceDataObject The properties of this object will be used to replace the placeholders in the template.\n * @constructs Resolver\n * @alias module:template_resolver.Resolver\n */\n function Resolver(sourceDataObject) {\n /**\n * The properties of this source data object will be used to replace the placeholders in the template.\n */\n this.sourceDataObject = sourceDataObject;\n /**\n * Resolves the given template.\n *\n * The template may contain variables in double curly brackets.\n * Supported variables are all properties of this object, e.g. \"{{fieldName}}\", \"{{displayName}}\", \"{{value}}\".\n * Since this object may also contains (described) groups of sub objects, they can also be used, e.g. \"{{summaries[0].value}}\"\n * Parts of the index can be inserted by using e.g. \"{{index[1]}}\".\n *\n * @param {string} template\n * @returns {string} resolved template\n */\n this.resolveTemplate = function (template) {\n return this.replaceResolvableFields(template, addFieldsPerGroup(this.resolvableFieldsOfAll(this.sourceDataObject)));\n };\n /**\n * Returns a map like object, that contains all resolvable fields and their values as properties.\n * This function takes a variable count of input parameters,\n * each containing an object that contains resolvable fields to extract from.\n *\n * The recursion depth is limited to 3, so that an object,\n * that contains an object can contain another object (but not further).\n *\n * Properties beginning with an underscore in their name will be filtered out, since they are considered as internal fields.\n *\n * @param {...object} varArgs variable count of parameters. Each parameter contains an object that fields should be resolvable for variables.\n * @returns {object} object with resolvable field names and their values.\n * @public\n */\n this.resolvableFieldsOfAll = function () {\n var map = {};\n var ignoreInternalFields = function (propertyName) {\n return propertyName.indexOf(\"_\") !== 0 && propertyName.indexOf(\"._\") < 0;\n };\n var index;\n for (index = 0; index < arguments.length; index += 1) {\n addToFilteredMapObject(internal_object_tools.flattenToArray(arguments[index], 3), map, ignoreInternalFields);\n }\n return map;\n };\n /**\n * Replaces all variables in double curly brackets, e.g. {{property}},\n * with the value of that property from the resolvableProperties.\n *\n * Supported property types: string, number, boolean\n * @param {string} stringContainingVariables\n * @param {object[]} resolvableFields (name=value)\n */\n this.replaceResolvableFields = function (stringContainingVariables, resolvableFields) {\n var replaced = stringContainingVariables;\n var propertyNames = Object.keys(resolvableFields);\n var propertyIndex = 0;\n var propertyName = \"\";\n var propertyValue = \"\";\n for (propertyIndex = 0; propertyIndex < propertyNames.length; propertyIndex += 1) {\n propertyName = propertyNames[propertyIndex];\n propertyValue = resolvableFields[propertyName];\n replaced = replaced.replace(\"{{\" + propertyName + \"}}\", propertyValue);\n }\n return replaced;\n };\n }\n\n /**\n * Adds the value of the \"fieldName\" property (including its group prefix) and its associated \"value\" property content.\n * For example: detail[2].fieldName=\"name\", detail[2].value=\"Smith\" lead to the additional property detail.name=\"Smith\".\n * @param {object} object with resolvable field names and their values.\n * @returns {object} object with resolvable field names and their values.\n * @protected\n * @memberof module:template_resolver.Resolver\n */\n function addFieldsPerGroup(map) {\n var propertyNames = Object.keys(map);\n var i, fullPropertyName, propertyInfo, propertyValue;\n for (i = 0; i < propertyNames.length; i += 1) {\n fullPropertyName = propertyNames[i];\n propertyValue = map[fullPropertyName];\n propertyInfo = getPropertyNameInfos(fullPropertyName);\n // Supports fields that are defined by a property named \"fieldName\" (containing the name)\n // and a property named \"value\" inside the same sub object (containing its value).\n // Ignore custom fields that are named \"fieldName\"(propertyValue), since this would lead to an unpredictable behavior.\n // TODO could make \"fieldName\" and \"value\" configurable\n if (propertyInfo.name === \"fieldName\" && propertyValue !== \"fieldName\") {\n map[propertyInfo.groupWithoutArrayIndices + propertyValue] = map[propertyInfo.group + \"value\"];\n }\n }\n return map;\n }\n\n /**\n * Infos about the full property name including the name of the group (followed by the separator) and the name of the property itself.\n * @param {String} fullPropertyName\n * @returns {Object} Contains \"group\" (empty or group name including trailing separator \".\"), \"groupWithoutArrayIndices\" and \"name\" (property name).\n * @protected\n * @memberof module:template_resolver.Resolver\n */\n function getPropertyNameInfos(fullPropertyName) {\n var positionOfRightMostSeparator = fullPropertyName.lastIndexOf(\".\");\n var propertyName = fullPropertyName;\n if (positionOfRightMostSeparator > 0) {\n propertyName = fullPropertyName.substr(positionOfRightMostSeparator + 1);\n }\n var propertyGroup = \"\";\n if (positionOfRightMostSeparator > 0) {\n propertyGroup = fullPropertyName.substr(0, positionOfRightMostSeparator + 1); //includes the trailing \".\".\n }\n var propertyGroupWithoutArrayIndices = propertyGroup.replace(removeArrayBracketsRegEx, \"\");\n return { group: propertyGroup, groupWithoutArrayIndices: propertyGroupWithoutArrayIndices, name: propertyName };\n }\n\n /**\n * Collects all flattened name-value-pairs into one object using the property names as keys and their values as values (map-like).\n * Example: `{name: \"accountNumber\", value: \"12345\"}` becomes `mapObject[\"accountNumber\"]=\"12345\"`.\n *\n * @param {NameValuePair[]} elements flattened array of name-value-pairs\n * @param {object} mapObject container to collect the results. Needs to be created before e.g. using `{}`.\n * @param {function} filterMatchesFunction takes the property name as string argument and returns true (include) or false (exclude).\n * @protected\n * @memberof module:template_resolver.Resolver\n */\n function addToFilteredMapObject(elements, mapObject, filterMatchesFunction) {\n var index, element;\n for (index = 0; index < elements.length; index += 1) {\n element = elements[index];\n if (typeof filterMatchesFunction === \"function\" && filterMatchesFunction(element.name)) {\n mapObject[element.name] = element.value;\n }\n }\n return mapObject;\n }\n\n return Resolver;\n}());\n","\"use strict\";\n/**\n * @fileOverview Modded (compatibility, recursion depth) version of: https://stackoverflow.com/questions/19098797/fastest-way-to-flatten-un-flatten-nested-json-objectss\n * @version ${project.version}\n * @see {@link https://stackoverflow.com/questions/19098797/fastest-way-to-flatten-un-flatten-nested-json-objectss|stackoverflow flatten nested json objects}\n */\nvar module = module || {}; // Fallback for vanilla js without modules\n\n/**\n * internal_object_tools. Not meant to be used outside this repository.\n * @default {}\n */\nvar internal_object_tools = module.exports={}; // Export module for npm...\n\n/**\n * @typedef {Object} NameValuePair\n * @property {string} name - point separated names of the flattened main and sub properties, e.g. \"responses[2].hits.hits[4]._source.name\".\n * @property {string} value - value of the property\n */\n\n/**\n * @param {object} data hierarchical object that may consist fo fields, subfields and arrays.\n * @param {number} maxRecursionDepth\n * @returns {NameValuePair[]} array of property name and value pairs\n */\ninternal_object_tools.flattenToArray = function (data, maxRecursionDepth) {\n var result = [];\n if (typeof maxRecursionDepth !== \"number\" || maxRecursionDepth < 1) {\n maxRecursionDepth = 20;\n }\n function recurse(cur, prop, depth) {\n if (depth > maxRecursionDepth || typeof cur === \"function\") {\n return;\n }\n if (Object(cur) !== cur) {\n result.push({ name: prop, value: cur });\n } else if (Array.isArray(cur)) {\n var i;\n var l = cur.length;\n for (i = 0; i < l; i += 1) {\n recurse(cur[i], prop + \"[\" + i + \"]\", depth + 1);\n }\n if (l === 0) {\n result[prop] = [];\n result.push({ name: prop, value: \"\" });\n }\n } else {\n var isEmpty = true;\n var p;\n for (p in cur) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p, depth + 1);\n }\n if (isEmpty && prop) {\n result.push({ name: prop, value: \"\" });\n }\n }\n }\n recurse(data, \"\", 0);\n return result;\n};\n","\"use strict\";\nrequire(\"../../lib/js/polyfills/indexOfPolyfill.js\");\nrequire(\"../../lib/js/polyfills/objectKeysPolyfill.js\");\nvar template_resolver = require(\"../../src/js/templateResolver.js\");\nmodule.exports = {template_resolver : template_resolver};\n"],"names":["$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","Object1","max","min","Array","prototype","indexOf","Object","Math","member","fromIndex","undefined","TypeError","that","Len","length","i","keys","o","p","k","hasOwnProperty","push","removeArrayBracketsRegEx","$9cb0fe3475961b60$var$module","$9cb0fe3475961b60$var$templateResolverInternalCreateIfNotExists","objectToCheck","$9cb0fe3475961b60$var$template_resolver","internalCreateIfNotExists","$9cb0fe3475961b60$var$internal_object_tools","RegExp","Resolver","sourceDataObject","resolveTemplate","template","replaceResolvableFields","addFieldsPerGroup","map","fullPropertyName","propertyInfo","propertyValue","propertyNames","getPropertyNameInfos","positionOfRightMostSeparator","lastIndexOf","propertyName","substr","propertyGroup","propertyGroupWithoutArrayIndices","replace","group","groupWithoutArrayIndices","name","resolvableFieldsOfAll","index","ignoreInternalFields","arguments","addToFilteredMapObject","elements","mapObject","filterMatchesFunction","element","value","flattenToArray","stringContainingVariables","resolvableFields","replaced","propertyIndex","$8e2fb4eb18d4597b$var$module","$8e2fb4eb18d4597b$var$internal_object_tools","data","maxRecursionDepth","result","recurse","cur","prop","depth","isArray","l","isEmpty","$ds403","template_resolver"],"version":3,"file":"templateResolver-ie.js.map","sourceRoot":"../"}
@@ -1,2 +1,2 @@
1
- var e=globalThis,r={},t={},n=e.parcelRequirec1f2;null==n&&((n=function(e){if(e in r)return r[e].exports;if(e in t){var n=t[e];delete t[e];var a={id:e,exports:{}};return r[e]=a,n.call(a.exports,a,a.exports),a.exports}var o=Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(e,r){t[e]=r},e.parcelRequirec1f2=n);var a=n.register;a("ds403",function(e,r){var t,a=o(a);function o(e){return e||{}}var i=a.exports={};i.internalCreateIfNotExists=o;var l=l||n("ccQZb");i.Resolver=(t=RegExp("\\[\\d+\\]","gi"),function(e){this.sourceDataObject=e,this.resolveTemplate=function(e){return this.replaceResolvableFields(e,function(e){var r,n,a,o,i=Object.keys(e);for(r=0;r<i.length;r+=1)o=e[n=i[r]],"fieldName"===(a=function(e){var r=e.lastIndexOf("."),n=e;r>0&&(n=e.substr(r+1));var a="";r>0&&(a=e.substr(0,r+1));var o=a.replace(t,"");return{group:a,groupWithoutArrayIndices:o,name:n}}(n)).name&&"fieldName"!==o&&(e[a.groupWithoutArrayIndices+o]=e[a.group+"value"]);return e}(this.resolvableFieldsOfAll(this.sourceDataObject)))},this.resolvableFieldsOfAll=function(){var e,r={},t=function(e){return 0!==e.indexOf("_")&&0>e.indexOf("._")};for(e=0;e<arguments.length;e+=1)(function(e,r,t){var n,a;for(n=0;n<e.length;n+=1)a=e[n],"function"==typeof t&&t(a.name)&&(r[a.name]=a.value)})(l.flattenToArray(arguments[e],3),r,t);return r},this.replaceResolvableFields=function(e,r){var t=e,n=Object.keys(r),a=0,o="",i="";for(a=0;a<n.length;a+=1)i=r[o=n[a]],t=t.replace("{{"+o+"}}",i);return t}})}),a("ccQZb",function(e,r){(($8e2fb4eb18d4597b$var$module||{}).exports={}).flattenToArray=function(e,r){var t=[];return("number"!=typeof r||r<1)&&(r=20),function e(n,a,o){if(!(o>r)&&"function"!=typeof n){if(Object(n)!==n)t.push({name:a,value:n});else if(Array.isArray(n)){var i,l=n.length;for(i=0;i<l;i+=1)e(n[i],a+"["+i+"]",o+1);0===l&&(t[a]=[],t.push({name:a,value:""}))}else{var u,s=!0;for(u in n)s=!1,e(n[u],a?a+"."+u:u,o+1);s&&a&&t.push({name:a,value:""})}}}(e,"",0),t}}),n("ds403");
1
+ var $parcel$global=globalThis,$parcel$modules={},$parcel$inits={},parcelRequire=$parcel$global.parcelRequirec1f2;null==parcelRequire&&((parcelRequire=function(e){if(e in $parcel$modules)return $parcel$modules[e].exports;if(e in $parcel$inits){var r=$parcel$inits[e];delete $parcel$inits[e];var t={id:e,exports:{}};return $parcel$modules[e]=t,r.call(t.exports,t,t.exports),t.exports}var a=Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}).register=function(e,r){$parcel$inits[e]=r},$parcel$global.parcelRequirec1f2=parcelRequire);var parcelRegister=parcelRequire.register;parcelRegister("ds403",function(e,r){"use strict";var t,a=l(a);function l(e){return e||{}}var n=a.exports={};n.internalCreateIfNotExists=l;var i=i||parcelRequire("ccQZb");t=RegExp("\\[\\d+\\]","gi"),n.Resolver=function(e){this.sourceDataObject=e,this.resolveTemplate=function(e){return this.replaceResolvableFields(e,function(e){var r,a,l,n,i=Object.keys(e);for(r=0;r<i.length;r+=1)n=e[a=i[r]],"fieldName"===(l=function(e){var r=e.lastIndexOf("."),a=e;r>0&&(a=e.substr(r+1));var l="";r>0&&(l=e.substr(0,r+1));var n=l.replace(t,"");return{group:l,groupWithoutArrayIndices:n,name:a}}(a)).name&&"fieldName"!==n&&(e[l.groupWithoutArrayIndices+n]=e[l.group+"value"]);return e}(this.resolvableFieldsOfAll(this.sourceDataObject)))},this.resolvableFieldsOfAll=function(){var e,r={},t=function(e){return 0!==e.indexOf("_")&&0>e.indexOf("._")};for(e=0;e<arguments.length;e+=1)!function(e,r,t){var a,l;for(a=0;a<e.length;a+=1)l=e[a],"function"==typeof t&&t(l.name)&&(r[l.name]=l.value)}(i.flattenToArray(arguments[e],3),r,t);return r},this.replaceResolvableFields=function(e,r){var t=e,a=Object.keys(r),l=0,n="",i="";for(l=0;l<a.length;l+=1)i=r[n=a[l]],t=t.replace("{{"+n+"}}",i);return t}}}),parcelRegister("ccQZb",function(e,r){"use strict";var t=t||{};(t.exports={}).flattenToArray=function(e,r){var t=[];return("number"!=typeof r||r<1)&&(r=20),!function e(a,l,n){if(!(n>r)&&"function"!=typeof a)if(Object(a)!==a)t.push({name:l,value:a});else if(Array.isArray(a)){var i,c=a.length;for(i=0;i<c;i+=1)e(a[i],l+"["+i+"]",n+1);0===c&&(t[l]=[],t.push({name:l,value:""}))}else{var s,o=!0;for(s in a)o=!1,e(a[s],l?l+"."+s:s,n+1);o&&l&&t.push({name:l,value:""})}}(e,"",0),t}}),parcelRequire("ds403");
2
2
  //# sourceMappingURL=templateResolver.js.map