- FormatTimestamp ⇒
FormatTimestamp
- removeSpace(str) ⇒
String
removeSpace
- hasEmojiInString(str) ⇒
Boolean
hasEmojiInString
- removeEmojis(str) ⇒
String
removeEmojis
- isVoidNull(param) ⇒
Boolean
isVoidNull
- isVoidNullEmptyString(param) ⇒
Boolean
isVoidNullEmptyString
- isNullArray(arr) ⇒
Boolean
isNullArray
- calculateDifference(difference) ⇒
Object
calculateDifference
- updateQueryStringParameter(uri, key, value) ⇒
String
Update or create query string
- updateQueryStringParameterByObj(uri, obj) ⇒
String
Update or create query string
- flat() ⇒
function
拍平一个多维数组
- timeDown(totalSeconds, fn) ⇒
*
timeDown
- isObjectValueEqual(a, b) ⇒
Boolean
isObjectValueEqual
- findIndex(arr, callback) ⇒
Number
findIndex
- rmArrayItem(arr, item) ⇒
Boolean
rmArrayItem
- timeFormatWithRule(timestamp, format) ⇒
String
timeFormatWithRule
- every(arr, fn) ⇒
Boolean
every
- some(arr, fn) ⇒
Boolean
some
- once(fn) ⇒
function
once
- isNumber(obj) ⇒
Boolean
isNumber
- isObj(obj) ⇒
Boolean
isObj
- isArray(obj) ⇒
Boolean
isArray
- isFunction(obj) ⇒
Boolean
isFunction
- deepClone(param) ⇒
*
deep clone
- distinctValuesOfArray() ⇒
Array
Returns all the distinct values of an array.
- timeTaken() ⇒
*
Measures the time taken by a function to execute.
- randomColor() ⇒
String
生成随机颜色
- randomString() ⇒
String
生成随机字符串
- checkStringType() ⇒
Boolean
- randomNum() ⇒
Number
生成随机数.
- getOS_FromAgent(agent, maxTouchPoints) ⇒
availableOS_Type
-
但是如果想要区分 ipad 和 iphone,需要传入第二个参数,该参数只能在浏览器内获取(navigator.maxTouchPoints),所以只能在浏览器端判断 原因是新版本的 iPadOS(>= 13.1) 和 mac 的 UA 是相同的,所以需要传入 maxTouchPoints 来判断
在浏览器端,可直接调用 dom util 中的 getOS_Type
- isObjKey(key, obj) ⇒
Boolean
- uuidv4() ⇒
String
Universally Unique IDentifier (RFC 4122 https://www.ietf.org/rfc/rfc4122.txt)
- extractImages(content) ⇒
Array
Extract images from Markdown or HTML
FormatTimestamp
Kind: global variable
Returns: *
Param | Type |
---|---|
timestamp | String |
removeSpace
Kind: global function
Param | Type |
---|---|
str | String |
hasEmojiInString
Kind: global function
Param | Type |
---|---|
str | String |
removeEmojis
Kind: global function
Param | Type |
---|---|
str | String |
isVoidNull
Kind: global function
Param | Type |
---|---|
param | any |
isVoidNullEmptyString
Kind: global function
Param | Type |
---|---|
param | any |
isNullArray
Kind: global function
Param | Type |
---|---|
arr | any |
calculateDifference
Kind: global function
Param | Type |
---|---|
difference | Number |
Update or create query string
Kind: global function
Param | Type |
---|---|
uri | String |
key | String |
value | String |
Update or create query string
Kind: global function
Param | Type |
---|---|
uri | String |
obj | Object |
拍平一个多维数组
Kind: global function
Example
flat()([
[1],
[[2],[3]],
[[4,[5]]]
])
timeDown
Kind: global function
Param | Type |
---|---|
totalSeconds | Number |
fn | function |
isObjectValueEqual
Kind: global function
Param | Type |
---|---|
a | Object |
b | Object |
findIndex
Kind: global function
Param | Type |
---|---|
arr | Array |
callback | function |
rmArrayItem
Kind: global function
Param | Type |
---|---|
arr | Array |
item | * |
timeFormatWithRule
Kind: global function
Param | Type | Description |
---|---|---|
timestamp | Number |
时间戳 |
format | String |
格式化规则 eg. Y-M-D H:m:S |
every
Kind: global function
Param | Type |
---|---|
arr | Array |
fn | function |
some
Kind: global function
Param | Type |
---|---|
arr | Array |
fn | function |
once
Kind: global function
Param | Type |
---|---|
fn | function |
isNumber
Kind: global function
Param | Type |
---|---|
obj | * |
isObj
Kind: global function
Param | Type |
---|---|
obj | * |
isArray
Kind: global function
Param | Type |
---|---|
obj | * |
isFunction
Kind: global function
Param | Type |
---|---|
obj | * |
deep clone
Kind: global function
Param | Type |
---|---|
param | Array | Object |
Returns all the distinct values of an array.
Kind: global function
Returns: Array
- - new array
Type | Description |
---|---|
Array |
source array |
Measures the time taken by a function to execute.
Kind: global function
Type | Description |
---|---|
function |
callback function |
生成随机颜色
生成随机字符串
Kind: global function
Type | Description |
---|---|
Number |
随机字符串长度 |
Kind: global function
Type | Description |
---|---|
String |
被检测的字符串 |
String |
检测类型 |
Example
URL_START_WITH_HTTP_OR_HTTPS | URL_NOT_REQUIRE_HTTP_OR_HTTPS |
email | phone | tel | number | lower | upper | ip
生成随机数.
Kind: global function
Type | Description |
---|---|
Number |
最小值 |
Number |
最大值 |
但是如果想要区分 ipad 和 iphone,需要传入第二个参数,该参数只能在浏览器内获取(navigator.maxTouchPoints),所以只能在浏览器端判断 原因是新版本的 iPadOS(>= 13.1) 和 mac 的 UA 是相同的,所以需要传入 maxTouchPoints 来判断
在浏览器端,可直接调用 dom util 中的 getOS_Type
Kind: global function
Param | Type | Description |
---|---|---|
agent | string |
user agent |
maxTouchPoints | number |
navigator.maxTouchPoints |
Kind: global function
Param | Type | Description |
---|---|---|
key | any |
key |
obj | T |
obj |
Universally Unique IDentifier (RFC 4122 https://www.ietf.org/rfc/rfc4122.txt)
Extract images from Markdown or HTML
Kind: global function
Param | Type | Description |
---|---|---|
content | string |
content |