eslint-plugin-mocha
Version:
Eslint rules for mocha.
22 lines • 690 B
JavaScript
export function convertNameToPathArray(name) {
return name.split('.');
}
function isPathPrefixOf(fullPath, pathToMatch) {
return pathToMatch.every((segment, index) => {
return segment === fullPath[index];
});
}
export function isSamePath(pathA, pathB) {
return isPathPrefixOf(pathA, pathB) && pathA.length === pathB.length;
}
export function getUniqueBaseNames(nameDetailsList) {
const baseNames = new Set();
for (const nameDetails of nameDetailsList) {
const [baseName] = nameDetails.path;
if (baseName !== undefined) {
baseNames.add(baseName);
}
}
return Array.from(baseNames);
}
//# sourceMappingURL=path.js.map