var service = {
clearPath: clearPath,
+ checkEmptyIdentifiers: checkEmptyIdentifiers,
createPathElement: createPathElement,
getModuleNameFromPath: getModuleNameFromPath,
getStorageAndNormalizedPath: getStorageAndNormalizedPath,
}
}
- // TODO: add service's description
+ /**
+ * Translate path url into path elements array
+ * @param path
+ * @param prefixConverter
+ * @param importNodes
+ * @param getDefaultModuleCallback
+ * @param notIdentifiers
+ * @returns {Array}
+ */
function translate(path, prefixConverter, importNodes, getDefaultModuleCallback, notIdentifiers) {
var pathStrElements = path.split('/').filter(function (e) {
return e !== '';
});
}
+ /**
+ * Check if in path elements array is empty identifier
+ * @param pathArray
+ * @returns {*}
+ */
+ function checkEmptyIdentifiers(pathArray){
+ return pathArray.some(function (item) {
+ return item.hasEmptyIdentifier();
+ });
+ }
+
/**
* Service for filling API url object from url string data
* @param pathArrayIn
return retObj;
}
- // TODO: add service's description
+ /**
+ * Fill path element's identifiers
+ * @param identifiers
+ * @param label
+ * @param value
+ */
function fillIdentifiers(identifiers, label, value) {
identifiers.some(function (i) {
var identifierMatch = i.label === label;
});
};
+ this.hasEmptyIdentifier = function () {
+ return this.identifiers.some(function (item) {
+ return item.value.length === 0;
+ });
+ };
+
this.toString = function () {
return (this.module ? this.module + ':' : '') + this.name + '/' + (this.hasIdentifier() ?
this.getIdentifierValues().join('/') + '/' : '');