Skip to content
Kyle Amos edited this page Sep 23, 2015 · 11 revisions

Table of Contents generated with DocToc

Class: jsocrud

jsocrud

new jsocrud()

jsocrud module

Source:

Methods

<static> get(object, path, defaultReturnValue) → {Object|Array|String|Boolean|Number}

Gets the value from the given object at the given path

Parameters:
Name Type Description
object Object

Object from which data is to be retrieved

path String

Path in the object where the desired data exists (e.g. ["foo"][2].bar)

defaultReturnValue Object | Array | String | Boolean | Number

Optional default return value if this.get() retrieves undefined or an error occurs. User beware: if undefined is passed as this argument, this function will act as if no default return value was set.

Source:
Returns:

Value in the object at the specified path

Type
Object | Array | String | Boolean | Number

<static> insert(object, path, value) → {Object}

Attempts to insert the given value into the given object at the given path. If attempting insert a deep value, all layers to that path must already exist in the object.

Parameters:
Name Type Description
object Object

Object in which to insert the value

path String

Path in the object to set the value - Example: ["foo"][2].bar

value Object | Array | String | Boolean | Number

Value to insert into the object

Source:
Returns:

Object after insertion

Type
Object

<static> remove(object, path) → {Object}

Deletes data from an object at the specified path

Parameters:
Name Type Description
object Object

Object from which data is to be deleted

path String

Path in the object to delete (e.g. ["foo"][2].bar)

Source:
Returns:

Object after removal

Type
Object

<static> set(object, path, value) → {Object}

Sets the given value in the given object at the given path

Parameters:
Name Type Description
object Object

Object in which value will be set

path String

Path in the object to set the value (e.g. ["foo"][2].bar)

value Object | Array | String | Boolean | Number

Value to set in the object

Source:
Returns:

Object after setting value

Type
Object

Generated with wicked.