header-case
Version:
Transform into a dash separated string of capitalized words
9 lines • 330 B
JavaScript
import { split, toLower, toUpper } from "no-case";
export function headerCase(input, options) {
const lower = toLower(options?.locale);
const upper = toUpper(options?.locale);
return split(input, options)
.map((x) => `${upper(x[0])}${lower(x.slice(1))}`)
.join("-");
}
//# sourceMappingURL=index.js.map