core_function
j-show edited this page Feb 28, 2019
·
1 revision
- Note
- Type recognition, which returns the target type in the form of a string
- Parameters
-
obj
Detect objects, which can be of any type -
detail=false
Whether to perform depth recognition
-
- Return
- Return string,return the target type by string form
- detail=false,reference types are recognized as object
- detail=true,name recognition for reference types
- Note
- Determine if the object is equal
- Parameters
-
a
、b
Detect objects, which can be of any type -
abs=true
Determine absolute equality when judging reference types (each data content is judged in depth)
-
- Return
- Return true/false
- Note
- Determine if the object is a simple type
- Parameters
-
value
Detect objects, which can be of any type
-
- Return
- Return true/false
- boolean/number/string,belonging to a simple type
- null/undefined,belonging to a simple type
- Note
- Determine if the object is null
- Parameters
-
value
Detect objects, which can be of any type -
opt
Detecting parameters-
opt.udf=true
Whether to count undefined as null -
opt.obj=false
Whether the array/object is empty is null - opt is boolean,equivalent opt.udf
-
-
- Return
- Return true/false
- Note
- Determine if the object is Boolean
- Parameters
-
value
Detect objects, which can be of any type -
str
Whether to judge strings- str=true,Forces value to be converted to string determination
-
- Return
- Return true/false
- Note
- Determine if the object is a number
- Parameters
-
value
Detect objects, which can be of any type -
opt
Detecting parameters-
opt.nan=false
Whether to count Nan as a number -
opt.str=false
Whether to convert strings to numeric judgments -
opt.int=true
Whether to recognize only integers -
opt.min=NaN
Number less than min, not counted as numbers -
opt.max=NaN
Number greater than Max, not counted as numbers - opt is boolean,equivalent opt.nan
-
-
- Return
- Return true/false
- opt.int=false,Floating-point numbers are recognized, and scientific notation can be identified when opt.str=true at the same time
- Note
- Determine if the object is string
- Parameters
-
value
Detect objects, which can be of any type -
empty=false
Whether an empty string is a string
-
- Return
- Return true/false
- Note
- Determine whether an object is function
- Parameters
-
value
Detect objects, which can be of any type -
type
Detecting parameters- type=true,async/generator is not function
- type can be valued as 'async', 'generator', at which point strict judgment types
-
- Return
- Return true/false
- Note
- Determine whether an object is an array
- Parameters
-
value
Detect objects, which can be of any type -
arg=false
Whether the arguments object counts as an array
-
- Return
- Return true/false
- Note
- Determines whether an object is objects and can be used to distinguish whether it is a JSON data object
- Parameters
-
value
Detect objects, which can be of any type -
arg
Detecting parameters- Default only recognition, basic object
-
arg='any'/true
Any reference type counts as Object -
arg=false
Any reference type is not equal to null is Object
-
- Return
- Return true/false
- Note
- Determine if the object is an Promise object
- Parameters
-
value
Detect objects, which can be of any type
-
- Return
- Return true/false
- Note
- Determine whether the object is generator, and both functions and objects return true
- Parameters
-
value
Detect objects, which can be of any type -
obj=false
Whether to detect generator objects
-
- Return
- Return true/false
- Note
- Determine if the object is a JSON object
- Parameters
-
value
Detect objects, which can be of any type
-
- Return
- Return true/false
- Note
- Determine if the object is a jquery object
- Parameters
-
value
Detect objects, which can be of any type
-
- Return
- Return true/false
- Note
- Determine if the object is a DOM object
- Parameters
-
value
Detect objects, which can be of any type
-
- Return
- Return true/false
- Note
- Determine if the object is an Dete object
- Parameters
-
value
Detect objects, which can be of any type -
str=false
Whether to recognize string content- str=true,will perform string content parsing
-
- Return
- Return true/false
- Note
- Determines whether an object is a Date object that contains time
- Parameters
-
value
Detect objects, which can be of any type -
str=false
Whether to recognize string content- str=true,String content parsing, and the content must contain a time format
-
- Return
- Return true/false
- Note
- Determine if the object is a GUID
- Parameters
-
value
Detect objects, which can be of any type- value=string,will perform content parsing
- Value values must conform to GUID rules
-
- Return
- Return true/false
- Note
- Determine whether the numbers are b1,b2 between
- Parameters
-
value
Detect objects, which can be of any type -
b1
、b2
Source of Judgment
-
- Return
- Return true/false
- This function is an unsafe function and will be perfected in subsequent versions
- Note
- Gets the callback function in the object
- Parameters
-
value
Detection object, which can be an array or arguments object -
index=0
Exclude the number of parameters- The function assumes that the last item of the detection object is a callback function, which is used to distinguish the number of parameters indexparameters when the decision is ignored
-
- Return
- Return function
- Note
- Object Traversal function
- Parameters
-
value
Traversing an object, which can be a array|object|string|set|map type -
callback(item, index, type, list)
Traversal function-
item
Traversing content -
index
Traversal serial Number,value=object,index is key -
type
Traversing content Types,opt.detail=true
, item is value type -
list
Real Traversal objects,opt.desc=true,Traversing an object is not equal to a real traversal object - When the traversal function returns to false inside, the traversal can be interrupted
-
-
opt
Detecting parameters-
opt.detail=false
Whether to identify traversal content types -
opt.force=false
Whether to force the use of array recognition -
opt.index=0
Start traversal position, effective when value=array/string -
opt.desc=false
Whether in reverse order, effective when value=array/string - opt=boolean,equivalent opt.detail
- opt=number,equivalent opt.index
-
-
- Return
- Return true/false,Whether to traverse complete
- Unable to traverse object or traverse interrupt, will return false
- Note
- unique function
- Parameters
-
value
Detection object must be an array object -
write=false
Whether to change the detection object- write=true,Will overwrite the value content, the reference remains the same
-
- Return
- Return array,has been de-reset the array
- Note
- Determines whether an object is contained within a list object
- Parameters
-
value
Detect objects, which can be of any type -
list
Detection list, which can be array/object/set/map object -
callback
Triggers a callback function when detection exists
-
- Return
- Return true/false
- Note
- Secure copy function
- Parameters
-
src
Copy sources, which can be of any type -
dest
Copy targets, which can be of any type -
opt
Detecting parameters-
opt.deep=false
Deep copy, and whether to merge content when the copy target is a reference type -
opt.write=true
Whether to rewrite dest- opt.write=true,Will overwrite the dest content, the reference remains the same
-
-
- Return
- Return Final copy content, type determined by src and dest
- WebBrowser
- Node.js