aem-clientlib-generator
Advanced tools
Comparing version 1.7.2 to 1.7.3
@@ -384,2 +384,4 @@ /* | ||
mapping = removeDuplicates(mapping, 'src'); | ||
asset.files = mapping; | ||
@@ -392,2 +394,13 @@ }); | ||
/** | ||
* Removes duplicates in array of Objects based on the provided key | ||
* From: https://firstclassjs.com/remove-duplicate-objects-from-javascript-array-how-to-performance-comparison/ | ||
* @param {Array} array - array of Objects that will be filtered | ||
* @param {String} key - key that will be used for filter comparison | ||
*/ | ||
function removeDuplicates(array, key) { | ||
let lookup = new Set(); | ||
return array.filter(obj => !lookup.has(obj[key]) && lookup.add(obj[key])); | ||
} | ||
/** | ||
* Process the given clientlib configuration object. | ||
@@ -414,3 +427,3 @@ * @param {ClientLibItem} item - clientlib configuration object | ||
var serializationFormat = (item.serializationFormat === SERIALIZATION_FORMAT_XML) ? SERIALIZATION_FORMAT_XML | ||
var serializationFormat = (item.serializationFormat === SERIALIZATION_FORMAT_XML) ? SERIALIZATION_FORMAT_XML | ||
: (item.serializationFormat === SERIALIZATION_FORMAT_SLING_XML) ? SERIALIZATION_FORMAT_SLING_XML | ||
@@ -417,0 +430,0 @@ : SERIALIZATION_FORMAT_JSON; |
{ | ||
"name": "aem-clientlib-generator", | ||
"version": "1.7.2", | ||
"version": "1.7.3", | ||
"description": "Creates configuration files for AEM ClientLibs and synchronizes assets.", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -102,2 +102,3 @@ /* | ||
files: [ | ||
"**/app.js", // this file should be included only once | ||
"**/*.js", // match all js files recursively | ||
@@ -104,0 +105,0 @@ "**/*.js.map" |
63435
945