0.0.7 • Published 5 months ago
wheat-tools v0.0.7
安装
npm install wheat-tools
导入
//js
const tools = require("wheat-tools");
//TS
import { tools } from "wheat-tools";
防抖函数
//fn需要执行的函数、delay需要防抖的延迟时间
tools.debounce(fn, delay);
节流函数
//fn需要执行的函数、delay需要节流的延迟时间
tools.throttle(fn, delay);
密码校验
//必须大小写、包含字母和数字,不少于8位
tools.passwordReg(str:String)
账号校验
//以字母或数字开头,允许中间包含下划线,最后以字母、数字或下划线结尾
tools.stringReg(str:String)
加密函数
tools.encrypt(str:String, key:String)
解密函数
tools.decrypt(str:String, key:String)