🦙
@dimplesyj/util
⌘K
Readme
Learn
API
/
@dimplesyj/util
88
Date
addDays
formatDate
getDaysOfLastMonth
getDaysOfMonth
getDaysOfWeek
getDaysToNowOfMonth
getFirstDayOfMonth
getFirstDayOfYear
getLastDayOfMonth
getNow
isAfter
isBefore
isBetween
subDays
toDate
Array
all
allEqual
insertAt
last
lastN
removeAt
String 驼峰化
camelize
String 首字母大写
capitalize
Object 清除对象中 undefined,null,[]空数组
clearNull
Object 深度拷贝对象
clone
Version 对比 version 的版本号
compareVersion
Misc 下载文件
download
Misc 浏览器下载静态文件
downloadFile
Image
drawImageVerify
String 转义HTML字符
escapeHTML
RegExp 转义字符串以在正则表达式中使用
escapeRegExp
String 根据数字获取对应的汉字
getHanByNumber
Object 比较一个值是否改变
hasChanged
Color
hexToRGB
rgbToHex
toHex
Misc 手机号码中间4位隐藏星号
hideMobile
String 大写字母 转为 小写-连接
hyphenate
String 插入字符串
insertStr
Misc 执行数组里的函数
invokeArrayFns
Is 是否为数组
isArray
Is
isDate
isFile
isFunction
isMap
isNull
isNumber
isObject
isPromise
isRegExp
isSet
isString
isSymbol
isUndef
isUndefined
Is 是否为空
isEmpty
Is 是否为纯粹的对象
isPlainObject
Misc nanoid
nanoid
Misc 键值对拼接成URL参数
params2Url
Random 随机布尔值
randomBoolean
Random 随机十六进制颜色
randomHexColorCode
Random 生成指定范围的随机整数
randomIntegerInRange
Random 生成指定范围的随机小数
randomNumberInRange
Random 随机 rgb 颜色
randomRgbColor
String 移除空格
removeWhitespace
String 替换所有相同字符串
replaceAll
Misc 将总秒数转换成 日:时:分:秒
seconds2DayTime
Misc 将总秒数转换成 时:分:秒
seconds2Time
Promise 睡眠
sleep
Misc 字符串哈希
stringHash
Vendor
to
String 将字符串转换为 camel
toCamelCase
String 字符数组
toCharArray
Number 保留小数点后面n位数字,四舍五入
toFix
String 将字符串转换为 kebab
toKebabCase
Number 转为数字
toNumber
String 将字符串转换为 pascal
toPascalCase
String 将字符串转换为 snake
toSnakeCase
Object 对象类型
toTypeString
String 去左右空格
trim
String 去所有空格
trimAll
Misc uuid
uuid
Other
FormatType
debounce
hasOwn
isEmptyString
objectToString
throttle
@dimplesyj/util