eigen-utils
v1.1.0
Published
common util tool functions for frontend.
Downloads
19
Readme
eigen-utils
Common util tool functions for frontend.
Installation
npm install eigen-utils --save
yarn add eigen-utils
Usage
import eigen from "eigen-utils"
eigen.md5("eigen")
eigen.isAlpha()
or
import { md5, isAlpha } from "eigen-utils"
md5("eigen")
isAlpha()
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
Recommand Usage
import md5 from "eigen-utils/md5"
md5("eigen")