lib/list.js
function(key, value) {
    if (typeof key !== 'string') {
      throw new TypeError('item key must be a string.');
    }
    if (typeof value === 'undefined') {
      return this.getItem(key);
    }
    this.addItem(key, value);
    return value;
  }
function(key, value) {
    if (typeof key !== 'string') {
      throw new TypeError('item key must be a string.');
    }
    if (typeof value === 'undefined') {
      return this.getItem(key);
    }
    this.addItem(key, value);
    return value;
  }
function ( key , value ) { if ( typeof key !== 'string' ) { throw new TypeError ( 'item key must be a string.' ) ; } if ( typeof value === 'undefined' ) { return this . getItem ( key ) ; } this . addItem ( key , value ) ; return value ; }
Get or Add an item to the list. Creates a new instance of `Item` when
adding.

```js
var list = new List();
list.item('foo', {name: 'foo'});
console.log(list.items);
//=> [{name: 'foo'}]
```

@param  {String} `name` Name of the item to get or add.
@param  {Object} `obj` Optional item to add or update.
@return {Object} `item`
@api public
Get or Add an item to the list . Creates a new instance of Item when adding .