UNPKG

@pmwcs/base

Version:
22 lines (17 loc) 470 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toDashCase = exports.toCamel = void 0; var toCamel = function toCamel(str) { return str.replace(/(-[a-z])/g, function ($1) { return $1.toUpperCase().replace('-', ''); }); }; exports.toCamel = toCamel; var toDashCase = function toDashCase(str) { return str.replace(/([A-Z])/g, function ($1) { return '-' + $1.toLowerCase(); }); }; exports.toDashCase = toDashCase;