UNPKG

rollun-ts-utils

Version:
1 lines 536 B
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.camelCaseToWords=camelCaseToWords;exports.camelCaseToSnake=camelCaseToSnake;exports.pad=pad;function camelCaseToWords(str){return str.replace(/([a-z])([A-Z])/g,"$1 $2")}function camelCaseToSnake(str){return str.replace(/([a-z])([A-Z])/g,"$1_$2").toLocaleLowerCase()}function pad(n,width){var symbol=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"0";var str="".concat(n);return str.length>=width?str:new Array(width-str.length+1).join(symbol)+str}