cbfl
Version:
library that can be used to automatically find points of failure in TypeScript Modules that are tested with Mocha
15 lines (14 loc) • 390 B
text/typescript
export const concatStringSet = (
stringSet: Set<string>,
valueCallback: (inValue: string) => string = (inValue) => inValue,
delimiter = ", "
): string => {
let resultString = "";
const values = stringSet.values();
let next = values.next();
while (!next.done) {
resultString += valueCallback(next.value) + delimiter;
next = values.next();
}
return resultString;
};