Manual Reference Source Test

Typedef

Static Public Summary
public

The function passed as a callback in a forEach iteration.

public

Returned object by getset

public

The function passed as a callback in a reduce iteration.

public

A dotted key is useful to quickly access a subset of data stored into the ObjectArray as if it was still a vanilla Object.

Static Public

public ForEachCallback: Function source

The function passed as a callback in a forEach iteration.

Four arguments will be provided to the callback :

  1. value {Object} : Value stored in the current iteration key
  2. key {String} : Current key in iteration
  3. index {Object} : Current index in iteration
  4. path {Object|undefined} : Path to the key It will be undefined if the key is at first level

public GetSetObject: Object source

Returned object by getset

Properties:

NameTypeAttributeDescription
get number | string | array | object

Value returned by the getter

set boolean

true if setter mode or false

public ReducerCallback: Function source

The function passed as a callback in a reduce iteration.

Four arguments will be provided to the callback :

  1. acc {Object} : Recursive accumulator value
  2. value {Object} : Value stored in the current iteration key
  3. key {String} : Current key in iteration
  4. path {Object|undefined} : Path to the key It will be undefined if the key is at first level

public dottedKey: String source

A dotted key is useful to quickly access a subset of data stored into the ObjectArray as if it was still a vanilla Object. Basically, a dotted key is constructed like a chain of property for an object.

Example:

 // Create an ObjectArray with subdata
 var oa = new ObjectArray({
   set1: {
     subset1: 'foo',
     subset2: {
       subsub1: 'bar',
       subsub2: 'baz'
     }
   }
 });

 oa.pull('set1.subset1'); // returns 'foo'
 oa.pull('set1.subset1.subsub2'); // returns 'baz'