piral-cli
Version:
The standard CLI for creating and building a Piral instance or a Pilet.
29 lines • 862 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.onlyUnique = onlyUnique;
exports.onlyUniqueFiles = onlyUniqueFiles;
const path_1 = require("path");
function onlyUnique(value, index, self) {
return self.indexOf(value) === index;
}
function onlyUniqueFiles(value, index, self) {
const valueDir = value + path_1.sep;
for (let i = 0; i < index; i++) {
const other = self[i];
if (other === value) {
return false;
}
const otherDir = other + path_1.sep;
if (value.startsWith(otherDir)) {
return false;
}
}
for (let i = index + 1; i < self.length; i++) {
const other = self[i];
if (other !== value && valueDir.startsWith(other)) {
return false;
}
}
return true;
}
//# sourceMappingURL=utils.js.map