ttk-app-core
Version:
enterprise develop framework
22 lines (18 loc) • 341 B
JavaScript
function trimLeft(str) {
return str.replace(/(^\s*)/g, "")
}
function trimRight(str) {
return str.replace(/(\s*$)/g, "")
}
function trim(str) {
return str.replace(/(^\s*)|(\s*$)/g, "")
}
function toJson(str) {
return (new Function("return " + str))()
}
export default {
trimLeft,
trimRight,
trim,
toJson
}