UNPKG

ttk-component

Version:

- 1、npm install ttk-component --save

22 lines (18 loc) 362 B
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 }