1.1.8 • Published 3 years ago

@bilzaa.com/arrayofobjects v1.1.8

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Array Of Objects

In Javascript we have built in functions for dealing with arrays as well as for objects BUT we need something to deal with 'Array of Objects'. This module is a wrapper around an array that stores objects. Each object should have a property named 'name' and a property named 'value'. There can not be two objects with the same name (each name of the object should be unique).

Usage

we create a new object by add method. add('nameOfTheObject) After an object has been created we can change its value using setAttr method. setAttr("name of the attribute"); To get the 'value' attribute of an object we use getAttr method. getAttr("name of the object");

The API

/**

  • 1--every objects must have a unique "name" field
  • 2--every OBJECT MUST HAVE "value" field. */
  • add(name:string,value:string|number|boolean);
  • length; //get length()
  • getItem(name:string); //not tested yet fully
  • getAttr(name:string,field= "value"):string|number|boolean
  • setAttr(name:string,value:string|number|boolean,field = "value"):string|number|boolean

THERE MAY BE BREAKING CHANGES IN NEAR FUTURE

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.0.5

3 years ago

0.0.5

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago