EIGEN-FUNC
EigenTech
Common JavaScript Functions ForAlready Have Methods
-
getAvatar()
get user avatar url (eigen use only) -
getCookie(name)
get cookie -
getRealname()
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 string -
hash(str)
hash a string to number -
uuid(len, radix)
generate uuid -
debounce(func, wait, immediate)
function debounce -
throttle(func, wait, options)
function throttle -
deepClone(object)
object deepclone -
type(variable)
judge variable type
How To Use
npm / cnpm install eigen-func --save
yarn add eigen-func
import eigen from "eigen-func"
eigen.md5("eigen")
eigen.isAlpha()
or
import { md5, isAlpha } from "eigen-func"
md5("eigen")
isAlpha()
If you only use the few methods in eigen-func, it is recommended to use the following writing method, which will make the packaged JS file smaller
import md5 from "eigen-func/lib/md5"
md5("eigen")