API Docs for: trial
Show:

nx Class

Module: nx

Item Index

Methods

clone

(
  • target
)
Object

Shallow clone target object.

Parameters:

  • target Object | Array

    The target object to be cloned.

Returns:

Object:

The cloned object.

compare

(
  • target
  • source
)
Number

Compare target and source.

Parameters:

  • target Object

    The target object.

  • source Object

    The source object.

Returns:

Number:

The result could be -1,0,1 which indicates the comparison result.

each

(
  • target
  • callback
  • context
)

Iterate over target and execute the callback with context.

Parameters:

  • target Object | Array | Iterable

    The target object to be iterate over.

  • callback Function

    The callback function to execute.

  • context Object

    The context object which act as 'this'.

extend

(
  • target
  • source
)
Object

Extend target with properties from sources.

Parameters:

  • target Object

    The target object to be extended.

  • source Object multiple

    The source objects.

Returns:

get

(
  • target
  • name
)

Get the specified property value of target.

Parameters:

  • target Object

    The target object.

  • name String

    The property name.

Returns:

:

The value.

gets

(
  • target
)
Object

Get all properties of target.

Parameters:

  • target Object

    The target Object.

Returns:

Object:

An object contains all keys and values of target.

has

(
  • target
  • name
)
Boolean

Check whether target has specified property.

Parameters:

  • target Object

    The target object.

  • name String

    The property name.

Returns:

is

(
  • target
  • type
)
Boolean

Check whether target is specified type.

Parameters:

  • target Object

    The target object to be checked.

  • type String | Function

    The type could either be a string or a class object.

Returns:

path

(
  • target
  • path
  • [value]
)

Get value from target specified by a path and optionally set a value for it.

Parameters:

  • target Object

    The target object.

  • path String

    The path.

  • [value] optional

    The value to be set.

Returns:

:

set

(
  • target
  • name
  • value
)

Set the specified property of target with value.

Parameters:

  • target Object

    The target object.

  • name String

    The property name.

  • value

    The value to be set.

sets

(
  • target
  • dict
)

Set a bunch of properties for target.

Parameters:

  • target Object

    The target object.

  • dict Object

    An object contains all keys and values to be set.