npm i rl-utils
import {**} from "rl-utils"
import * as rlUtils from "rl-utils"
- isString:字符串验证
- isBoolean:Boolean验证
- isNumber:Number验证
- isNull:Null验证
- isUndefined:Undefined验证
- isFunction:Function验证
- isArray:Array验证
- isObject:Object验证
- isDate:Date验证
- isSymbol:Symbol验证
- isQuoteType:引用类型判断
import {TypeValidate} from "rl-utils";
const isStr=TypeValidate.isString('about');
const {isString,isBoolean,isNumber,isNull}=TypeValidate;
- asyncDiffType:异步参数类型比较
- syncDiffType:同步参数类型比较
- asyncDiffVal:异步参数值比较
- syncDiffVal:同步参数值比较
import {ArgCheck} from "rl-utils";
ArgCheck.asyncDiffType('about','about').then(res=>{console.log(res)});
const {asyncDiffType,syncDiffType,asyncDiffVal,syncDiffVal}=ArgCheck;
- formatting:兼容ios时间格式
- getDate:获取日期
- dateDiff:日期对比
import {timer} from "rl-utils";
const formatting=timer.formatting('2022-01-01');
const {formatting,getDate,dateDiff}=timer;
- toNumber:转换Number类型
- toPrice:金额,保留2位小数点
- computedConent:计算内容
- add:加法
- sub:减法
- mul:乘法
- div:除法
import {NumberComputed} from "rl-utils";
const add=NumberComputed.add(1.33,3.14);
const {toNumber,toPrice,computedConent,add,sub,mul,div}=NumberComputed;
import {getUUID} from "rl-utils";
import {apiPath} from "rl-utils";
const basePath=apiPath('http://dev.com')
const imgUpload=basePath('/img/upload')
import {imgCompress} from "rl-utils";
imgCompress.then(res=>{
debugger
})
欢迎交流(QQ:466027219)
待更新...