UNPKG

362 BJavaScriptView Raw
1function trimLeft(str) {
2 return str.replace(/(^\s*)/g, "")
3}
4
5function trimRight(str) {
6 return str.replace(/(\s*$)/g, "")
7}
8
9function trim(str) {
10 return str.replace(/(^\s*)|(\s*$)/g, "")
11}
12
13function toJson(str) {
14 return (new Function("return " + str))()
15}
16
17export default {
18 trimLeft,
19 trimRight,
20 trim,
21 toJson
22}
\No newline at end of file