online-judge-supporter
Version:
A tool to support competitve programmer
14 lines (13 loc) • 364 B
JavaScript
const getTestIndexFromTestName = (name, regexes, indexPosition) => {
for (const regex of regexes) {
const match = name.match(regex);
if (match && match.length > indexPosition && match[indexPosition]) {
return match[indexPosition];
}
}
return undefined;
};
export { getTestIndexFromTestName };
export default {
getTestIndexFromTestName
};