0.0.41 • Published 4 years ago

zinutils v0.0.41

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

zinUtils

Quickstart

Installation

npm install zinutils
import { [MODUELs] } from "zinutils"

[MODUELs].Function()

Initial configuration

(Optional, but not entirely optional, still initialized XD)

// main.js

// For vite
import "zinutils/init/vite";
// For vue/cli
import "zinutils/init/webpack";
// Other (or not import, window.znConf.isDevelopment will default to true)
import "zinutils/init";

window.znConf | Variable name | Description | type | Default | | ------------- | ------------------ | :-----: | :-------: | | isDevelopment | Lazy to explain :D | Boolean | true | | isIOS | Lazy to explain :D | Boolean | undefined | | isIPad | Lazy to explain :D | Boolean | undefined | | isAndroid | Lazy to explain :D | Boolean | undefined | | isPC | Lazy to explain :D | Boolean | undefined |

Global binding for vue

// main.js

// Vue 3
import { vue3 as zinUtils } from "zinutils/init";
// Vue 2
import { vue3 as zinUtils } from "zinutils/init";

App.use(zinUtils);

Usage

this.$dev.log("Good day");

Module

Contents

common

import { common } from "zinutils";
Function
Function nameDescriptionParameterDescriptiontypereturn
debouncesee herefunc, delayLazy to explain :D-Guess
getParamGet a url parameterparamNameLazy to explain :DStringString/null

check

import { check } from "zinutils";
Function
Function nameDescriptionParameterDescriptiontypereturn
isNullIs nullcontent-Array/Object/StringBoolean
hasNullObj/arr's sub item has nulltestBuffer, useGenerator = falseLook source codeArray/ObjectBoolean
isObjectisObjectcheckBuffer, includeArray = false-AnyBoolean
isPhoneIs phone numberphone--Boolean

time

import { time } from "zinutils";
Function
Function nameDescriptionParameterDescriptiontypereturn
sleepLike python's time.sleep, need to use awaitms--Void

filter

import { filter } from "zinutils";
Function
Function nameDescriptionParameterDescriptiontypereturn
limitLenLength limitcontent, lengthContent and target lengthStringString
parseNumRemove other characters except numbers in the stringcontent-StringString

encrypt

import { encrypt } from "zinutils";

encrypt.md5 (See md5.js for more info.)

Function
Function nameDescriptionParameterDescriptiontypereturn
hexhex_md5sLazy to explain :D-String
base64b64_md5sLazy to explain :D-String
anyany_md5s,eLazy to explain :D-String

encrypt.hmacmd5 (See md5.js for more info.)

Function
Function nameDescriptionParameterDescriptiontypereturn
hexhex_hmac_md5k,dLazy to explain :D-String
base64b64_hmac_md5k,dLazy to explain :D-String
anyany_hmac_md5k,d,eLazy to explain :D-String

auth

import { auth } from "zinutils";
Function
Function nameDescriptionParameterDescriptiontypereturn
getFingerPrintGet browser fingerprint (not unique)---String

mobile

import { mobile } from "zinutils";

// You can also import it directly into main.js, It will automatically execute some functions (Now only disableZoom)
import "zinutils/mobile";

Function

Function nameDescriptionParameterDescriptiontypereturn
disableZoomDisable mobile zooming via meta tag---Void
disableElasticScrollingDisable IOS elastic scrolling---Void
enableElasticScrollingenable IOS elastic scrolling---Void
inputRecFix the rebound error of input box under IOSinputElinput elementStringVoid
inputsRecFix the rebound error of input box under IOSwrapElParent element of multiple inputsStringVoid

dev

Need to initialize configuration

import { dev } from "zinutils";
Function
Function nameDescriptionParameterDescriptiontypereturn
logOutput log in development environment----
logErrorOutput error in development environment----
logWarnOutput warn in development environment----
0.0.40

4 years ago

0.0.41

4 years ago

0.0.38

4 years ago

0.0.39

4 years ago

0.0.37

4 years ago

0.0.32

4 years ago

0.0.33

4 years ago

0.0.34

4 years ago

0.0.35

4 years ago

0.0.36

4 years ago

0.0.31

4 years ago

0.0.24

4 years ago

0.0.25

4 years ago

0.0.30

4 years ago

0.0.27

4 years ago

0.0.28

4 years ago

0.0.20

4 years ago

0.0.21

4 years ago

0.0.22

4 years ago

0.0.23

4 years ago

0.0.16

4 years ago

0.0.17

4 years ago

0.0.18

4 years ago

0.0.19

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.13

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

0.0.0

4 years ago