web-xiu

1.2.0 • Public • Published

web-xiu 工具函数

good good study, day day up!

效果预览

👉预览地址:请点我!在线预览


工具类别

金额类验证 + 用户信息验证 + 邮箱联系方式验证 ...

工具描述

  • 金额类验证
  • 用户信息验证
  • 邮箱联系方式验证
  • 字符串处理
  • 数组结构
  • 对象解构
  • 循环

具体功能实现

代码片段

 function html_encode(str) {
     var s = '';
     if (str.length == 0) return "";
     s = str.replace(/&/g, "&");
     s = s.replace(/</g, "&lt;");
     s = s.replace(/>/g, "&gt;");
     s = s.replace(/\s/g, "&nbsp;");
     s = s.replace(/\'/g, "&#39;");
     s = s.replace(/\"/g, "&quot;");
     s = s.replace(/\n/g, "<br/>");
     return s;
 }

Install

# install dependencies
npm i web-xiu --save
 
# use dependencies
let webXiu = require("web-xiu")
webxiu.formatDouble(30,2)
 
 

For detailed explanation on how things work, checkout the contact me and docs for vue ,docs for ES6.

Package Sidebar

Install

npm i web-xiu

Weekly Downloads

1

Version

1.2.0

License

MIT

Unpacked Size

11.6 kB

Total Files

3

Last publish

Collaborators

  • webxiu