Global

Members


<constant> _ :lodash

Type:
  • lodash
Source:
index.js

<constant> move

Some immutable array helpers!

Source:
array/index.js

Methods


dbgGetCallerFile(depth)

Get the nth call file name from callstack

Parameters:
Name Type Default Description
depth integer 1

the nth depth, 0 means the file call this function, usually depth 1 is most expected result

Source:
lang/dbgGetCallerFile.js
Returns:

filename

Type
string

defaultDeep(obj, sources)

Fallback to default value according to the sequence of sources, if the value of a key in all sources is null or undefined.

Parameters:
Name Type Argument Description
obj object

immutable object.

sources object <repeatable>
Source:
object/defaultDeep.js
Returns:

Merged object.

Type
object

flattenObject(object, keyPathSep)

Convert a hierachy object into a flat object with the key path sperarated by a given string, default as ".".

Parameters:
Name Type Default Description
object *
keyPathSep * .
Source:
object/flattenObject.js
Returns:
Type
object

isInteger(value)

Check a number or string whether it is exactly an integer

Parameters:
Name Type Description
value *
Source:
validators/isInteger.js
Returns:
Type
boolean

simpleCsvParser(str [, options])

Parse csv string into array, simple implementation especially for one-line parsing.
23x faster than csv-parse for single line parsing
10x faster than csv-parse/sync for single line parsing

split + simpleCsvParser, however split('\n') is not good for massive data, should use stream reader instead
5x faster than csv-parse/sync for multiple lines parsing

Parameters:
Name Type Argument Description
str string
options object <optional>
Properties:
Name Type Argument Default Description
options.delimiter string <optional>
','
options.emptyAsNull boolean <optional>
false
Source:
string/simpleCsvParser.js
Returns:
Type
array