jsmodern
Version:
An extension to existing JavaScript, influenced by other great languages such as Rust, Dart, Java, Golang, etc.
11 lines • 351 B
JavaScript
import { postCase, preCase } from './to-case';
export const toKebabCase = {
label: 'toKebabCase',
fn: function stringToKebabCase() {
const ctx = this;
return !ctx.length ?
'' :
postCase(preCase(ctx).replace(/\b[a-zA-z]/gi, s => s.toLowerCase()), '-');
},
};
//# sourceMappingURL=to-kebab-case.js.map