UNPKG

d2-ui

Version:
17 lines (14 loc) 421 B
/** * Converts a camel-case string to a dash-case string * @param {string} str - str that gets converted to dash-case */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); exports['default'] = function (str) { return str.replace(/([a-z]|^)([A-Z])/g, function (match, p1, p2) { return p1 + '-' + p2.toLowerCase(); }).replace('ms-', '-ms-'); }; module.exports = exports['default'];