eigen-utils
Common util tool functions for frontend.
Installation
npm install eigen-utils --saveyarn add eigen-utils
Usage
eigeneigen
or
Tool functions
getAvatar()
get user avatar url (eigen use only)getCookie(name)
get cookiegetRealname()
get current user realname (eigen use only)getUsername()
get current user username (eigen use only)isAlpha()
judge current env is alpha or production (same to isDevMode())(eigen use only)md5(str, bit)
md5 stringhash(str)
hash a string to numberuuid(len, radix)
generate uuiddebounce(func, wait, immediate)
function debouncethrottle(func, wait, options)
function throttledeepClone(object)
object deepclonetype(variable)
judge variable typebase64()
encode and deconde stringisJSON(variable)
judge variable is JSON