0.0.13 • Published 1 year ago
@yangss/utils v0.0.13
@yangss/utils
A collection of common JavaScript / TypeScript utils
- Tree-shakable ESM
- Fully typed
- Type utilities
- Zero dependencies
Install
# npm
npm i @yangss/utils
# yarn
yarn add @yangss/utils
Utils
assertion
isString
isNumber
isBoolean
isArray
isObject
isFunction
isSymbol
isUndef
isNull
isPrimitive
isSameType
isPromise
isRegExp
isSet
isMap
isFalsy
isEqual
isBrowser
isMobile
isPhoneNumber
isEmail
array
toArray
at
unique
string
ensurePrefix
splitStrByLen
splitStrByLenReverse
reverseStr
upperFirst
lowerFirst
capitalize
camelCase
kebabCase
snakeCase
number
toNumber
add
subtract
multiply
divide
toThousandSeparated
random
toFixedNum
function
throttle
debounce
deepClone
deepMerge
uniqueId
browser
fileToBase64
downloadFile
triggerWindowResize
onWindowResize
getTextWidth
getTextWidthByCanvas