toPlainObject

This function converts an iterable object or a plain object to new a plain object

toPlainObject(v: (Iterable | Object), callback: function?, context: any?): Object
Parameters
v ((Iterable | Object)) an iterable object or a plain object
callback (function?) Function which will be call on every element of an iterable object or a plain object
context (any?) Value which will be used as context(this) when executed callback function
Returns
Object: New plain object
Example
toPlainObject([1, 2, 3]) // {0: 1, 1: 2, 2: 3}

toMap

This function converts an iterable object or a plain object to new a map object

toMap(v: (Iterable | Object), callback: function?, context: any?): Map<string, any>
Parameters
v ((Iterable | Object)) An iterable object or a plain object
callback (function?) Function which will be call on every element of an iterable object or a plain object
context (any?) Value which will be use as context(this) when executed callback function
Returns
Map<string, any>: New map object
Example
toMap([1, 2, 3]) // Map(3){"x" => 1, "y" => 2, "z" => 3}

toSet

This function converts an iterable object or a plain object to new a set object

toSet(v: (Iterable | Object), callback: function?, context: any?): Set<any>
Parameters
v ((Iterable | Object)) An iterable object or a plain object
callback (function?) Function which will be call on every element of an iterable object or a plain object
context (any?) Value which will be use as context(this) when executed callback function
Returns
Set<any>: New set object
Example
toSet({ x: 1, y: 2, z: 3 }) // Set(3){{ ... }, { ... }, { ... }

toSetAll

This function converts an any value to new a set object

toSetAll(v: any, callback: function?, context: any?): Array<any>
Parameters
v (any) An any value
callback (function?) Function which will be call on every element of an iterable object or a plain object
context (any?) Value which will be use as context(this) when executed callback function
Returns
Array<any>: New set object
Example
toSetAll(undefined) // Set { undefined }

toArray

This function converts an iterable object or a plain object to new an array object

toArray
Parameters
v ((Iterable | Object)) An iterable object or a plain object
callback (function?) Function which will be call on every element of an iterable object or a plain object
context (any?) Value which will be use as context(this) when executed callback function
Returns
Array:
Example
toArray({ x: 1, y: 2, z: 3 }); // [{ k: 'x', v: 1 }, { k: 'y', v: 2 }, { k: 'z', v: 3 }]

toArrayAll

This function converts an any value to new an array object

toArrayAll
Parameters
v (any) An any value
callback (function?) Function which will be call on every element of an iterable object or a plain object
context (any?) Value which will be use as context(this) when executed callback function
Returns
Array:
Example
toArrayAll(undefined) // [undefined]

assign

This function assigns several source objects to a target object

assign(targetObject: (Iterable | Object), sourceObjects: Object): Object
Parameters
targetObject ((Iterable | Object)) target object which will be assigned
sourceObjects (Object) Source objects which to assign to a target object
Returns
Object: New target object
Example
assign([1, 2, 3], 33, 33, 44) // [ 1, 2, 3, 33, 33, 44 ]

entries

This function returns new array object with [key, value] pair

entries(v: (Iterable | Object)): Array
Parameters
v ((Iterable | Object)) An iterable object or a plain object
Returns
Array: New array object
Example
entries({ x: 1, y: 2, z: new Map([['x', 1]]) }) // [['x', 1], ['y', 2], ['z', Map { 'x' => 1 }]]

copy

This function returns new value which shallow copied of given value

copy(v: any, context: any?): any
Parameters
v (any) Value which will be copy
context (any?) Context(this) which will be bind if function type
Returns
any: Copied value
Example
copy(new Map([['x', 1], ['y', 2]])) // Map { 'x' => 1, 'y' => 2 }

deepCopy

This function returns new value which deep copied of given value

deepCopy(v: any, callback: function?, context: any?): any
Parameters
v (any) Value which will be copy
callback (function?) Function which will be call on every element of given value
context (any?) Value which will be used as context(this) when executed callback function
Returns
any: Copied value
Example
deepCopy({ x: { y: new Map([['x', { x: { y: function() {}, z: new Set([1, 2, 3]) } }]]) } }) // { x: { y: Map { 'x' => [Object] } } }

deepFreeze

This function will be deeply freeze of given object

deepFreeze(v: any): any
Parameters
v (any) Value which will be frozen
Returns
any:
Example
deepFreeze({ x: { y: { z: () => {} } } })

deepSeal

This function will be deeply seal of given object

deepSeal(v: (Iterable | Object)): Object
Parameters
v ((Iterable | Object)) Iterable object or Plain object
Returns
Object:
Example
deepSeal({ x: { y: { z: () => {} } } })

deepPreventExtensions

This function will be prevent extended of given object

deepPreventExtensions(v: (Iterable | Object)): Object
Parameters
v ((Iterable | Object)) Iterable object or Plain object
Returns
Object:
Example
deepPreventExtensions({ x: { y: { z: () => {} } } })

hasProp

This function returns whether has a property in given object

hasProp(v: (Iterable | Object), k: string): boolean
Parameters
v ((Iterable | Object)) Iterable object or Plain object
k (string) key
Returns
boolean:
Example
hasProp({ x: { y: { z: () => {} } } }, 'x') // true

deepHasProp

This function returns whether has a property in given object

deepHasProp(v: (Iterable | Object), k: string): boolean
Parameters
v ((Iterable | Object)) Iterable object or Plain object
k (string) key
Returns
boolean:
Example
deepHasProp({ x: { y: { z: () => {}, x: { y: { zz: 1 } } } } }, 'zz') // true

deepHasExtensible

This function returns whether has extensible of given object

deepHasExtensible(v: (Iterable | Object)): boolean
Parameters
v ((Iterable | Object)) Iterable object or Plain object
Returns
boolean:
Example
deepHasExtensible(obj)

deepHasFrozen

This function returns whether has freeze of given object

deepHasFrozen(v: (Iterable | Object)): boolean
Parameters
v ((Iterable | Object)) Iterable object or Plain object
Returns
boolean:
Example
deepHasFrozen(obj)

deepHasSealed

This function returns whether seal of given object

deepHasSealed(v: (Iterable | Object)): boolean
Parameters
v ((Iterable | Object)) Iterable object or Plain object
Returns
boolean:
Example
deepHasSealed(obj)

hasInstanceOf

This function returns whether included a constructor in prototype object

hasInstanceOf(v: (Iterable | Object), constructor: Object): boolean
Parameters
v ((Iterable | Object)) Iterable object or Plain object
constructor (Object)
Returns
boolean:
Example
hasInstanceOf(obj, constructor) // true

insert

This function inserts a value from a target index of an array object or a set object

insert(v: (Array | Set), targetIndex: number, values: any): (Set | Array)
Parameters
v ((Array | Set)) An Array object or a Set object
targetIndex (number) Target index
values (any) Values which will be inserted
Returns
(Set | Array):
Example
insert([1, 2, 3, 4], 1, 22) // [1, 22, 2, 3, 4]

replace

This function replaces from target index value of an array object or a set object to new values

replace(v: (Array | Set), targetIndex: number, values: any): (Set | Array)
Parameters
v ((Array | Set)) An Array object or a Set object
targetIndex (number) Target index
values (any) Values which will be replaced
Returns
(Set | Array):
Example
replace([1, 2, 3, 4], 2, 33, 'ADD') // [1, 2, 33, 'ADD', 4]

unshift

This function inserts a value from first index of an iterable object or a plain object

unshift(v: (Array | Set), values: any): (Set | Array)
Parameters
v ((Array | Set)) An Array object or a Set object
values (any) Values which will be inserted
Returns
(Set | Array):
Example
unshift([1, 2, 3], 11, 22, 33) // [ 11, 22, 33, 1, 2, 3 ]

push

This function inserts a value from last index of an iterable object or a plain object

push(v: (Array | Set), values: any): (Set | Array)
Parameters
v ((Array | Set)) An Array object or a Set object
values (any) Values which will be inserted
Returns
(Set | Array):
Example
push([1, 2, 3], 11, 22, 33) // [ 1, 2, 3, 11, 22, 33 ]

remove

This function removes a value at a target index of an array object or a set object

remove(v: (Array | Set), callback: function, fromIndex: number): (Set | Array)
Parameters
v ((Array | Set)) An Array object or a Set object
callback (function) Function which will be call on every element of an iterable object or a plain object
fromIndex (number = 0) Start index which will be search
Returns
(Set | Array):
Example
remove(['1', 2, 3, 4], v => typeof v === 'number'); // ['1']

size

This function returns a length of an iterable object or plain object

size(v: (Iterable | Object)): number
Parameters
v ((Iterable | Object)) An iterable object or a plain object
Returns
number:
Example
size(new Map([['x', 1]])) // 1

forEach

This function will be call every element of an iterable object or a plain object

forEach
Parameters
v ((Iterable | Object)) An iterable object or a plain object
callback (function) Function which will be call on every element of an iterable object or a plain object
context (any?) Value which will be use as context(this) when executed callback function
Example
forEach('test', (v, k) => console.log(v)); // 't', 'e', 's', 't'

of

This function returns new an array object which includes an every arguments

of
Parameters
values (any) Values which will be included
Returns
Array:
Example
of(1, 2, 3, 4); // [1, 2, 3, 4]

indexOf

This function returns index of found value from an iterable object or a plain object

indexOf
Parameters
v ((Iterable | Object)) An iterable object or a plain object
callback (function) Function which will be call on every element of an iterable object or a plain object
fromIndex (number = 0) Start index which will be search
Returns
number:
Example
indexOf([1, 2, 3], v => v === 2); // 1

lastIndexOf

This function returns index of found value from an iterable object or a plain object

lastIndexOf
Parameters
v ((Iterable | Object)) An iterable object or a plain object
callback (function) Function which will be call on every element of an iterable object or a plain object
fromIndex (number = Iterable.length-1) Start index which will be search from last index
Returns
number:
Example
lastIndexOf([1, 2, 3], v => v === 3); // 2

join

This function returns joined value as a separator from every elements of an iterable object or a plain object

join
Parameters
v ((Iterable | Object)) An iterable object or a plain object
separator (any) separate value
Returns
string:
Example
join({ x: 1, y: 2, z: 3 }, '-') // '1-2-3'

keys

This function returns index of found value from an iterable object or a plain object

keys
Parameters
v ((Iterable | Object)) An iterable object or a plain object
Returns
Array:
Example
keys([1, , 3]) // [0, 1, 2]

values

This function returns index of found value from an iterable object or a plain object

values
Parameters
v ((Iterable | Object)) An iterable object or a plain object
Returns
Array:
Example
values({ x: 1, y: 2, z: 3 }) // [1, 2, 3]

find

This function returns a first element found from an iterable object or a plain object

find
Parameters
v ((Iterable | Object)) An iterable object or a plain object
callback (function) Function which will be call on every element of an iterable object or a plain object
context (any?) Value which will be use as context(this) when executed callback function
Returns
any:
Example
find(['1', 2, 3], v => typeof v === 'number') // 2

findIndex

This function returns an index of first element found from an iterable object or a plain object

findIndex
Parameters
v ((Iterable | Object)) An iterable object or a plain object
callback (function) Function which will be call on every element of an iterable object or a plain object
context (any?) Value which will be use as context(this) when executed callback function
Returns
number:
Example
findIndex(['1', 2, 3], v => typeof v === 'number') // 1

deepFind

This function returns a first element found from an iterable object or a plain object

deepFind
Parameters
v ((Iterable | Object)) An iterable object or a plain object
callback (function) Function which will be call on every element of an iterable object or a plain object
context (any?) Value which will be use as context(this) when executed callback function
Returns
Object:
Example
deepFind([{ x: { xx: { y: 3, z: 'A' } } }], v => typeof v === 'number') // { c: { y: 3, z: 'A' }, k: 'y', v: 3, origin: [{ ... }] }

includes

This function returns whether in an array includes certain value and is not

includes
Parameters
v ((Iterable | Object)) An iterable object or a plain object
callback (function) Target Value which will be search
start (number?) Start index which to searching
Returns
boolean:
Example
includes([1, 2, 3], v => v === 2) // true

asc

This function returns new array object sorted to ascending

asc
Parameters
v ((Iterable | Object)) An iterable object or a plain object
Returns
Array:
Example
asc({ x: 'd', y: null, z: 0xff }) // [null, 'd', 255]

desc

This function returns new array object sorted to descending

desc
Parameters
v ((Iterable | Object)) An iterable object or a plain object
Returns
Array:
Example
desc(['d', true, undefined, 0xff, 'ee', [], 2e4, () => {}, 't', 0]) // [20000, 255, 'ee', 't', 'd', true, Array(0), f (), 0, undefined]

ascBy

This function returns new array object sorted ascending by object key

ascBy
Parameters
v ((Iterable | Object)) An iterable object or a plain object
key (string)
Returns
Array:
Example
ascBy([{ x: 1, y: 11 }, { x: 2, y: 22 }, { x: 3, y: 33 }], 'y') // [{ ...y: 11 }, { ...y: 22 }, { ...y: 33 }]

descBy

This function returns new array object sorted descending by object key

descBy
Parameters
v ((Iterable | Object)) An iterable object or a plain object
key (string)
Returns
Array:
Example
descBy([{ x: 1, y: 11 }, { x: 2, y: 22 }, { x: 3, y: 33 }], 'y') // [{ ...y: 33 }, { ...y: 22 }, { ...y: 11 }]