lib/collection/property-list.js
function (item) {
        // do not proceed on empty param, but empty strings are in fact valid.
        // eslint-disable-next-line lodash/prefer-is-nil
        if (_.isNull(item) || _.isUndefined(item) || _.isNaN(item)) { return; }

        // create new instance of the item based on the type specified if it is not already
        this.insert((item.constructor === this.Type) ? item :
            // if the property has a create static function, use it.
            // eslint-disable-next-line prefer-spread
            (_.has(this.Type, 'create') ? this.Type.create.apply(this.Type, arguments) : new this.Type(item)));
    }
function (item) {
        // do not proceed on empty param, but empty strings are in fact valid.
        // eslint-disable-next-line lodash/prefer-is-nil
        if (_.isNull(item) || _.isUndefined(item) || _.isNaN(item)) { return; }

        // create new instance of the item based on the type specified if it is not already
        this.insert((item.constructor === this.Type) ? item :
            // if the property has a create static function, use it.
            // eslint-disable-next-line prefer-spread
            (_.has(this.Type, 'create') ? this.Type.create.apply(this.Type, arguments) : new this.Type(item)));
    }
function ( item ) { // do not proceed on empty param, but empty strings are in fact valid. // eslint-disable-next-line lodash/prefer-is-nil if ( _ . isNull ( item ) || _ . isUndefined ( item ) || _ . isNaN ( item ) ) { return ; } // create new instance of the item based on the type specified if it is not already this . insert ( ( item . constructor === this . Type ) ? item : // if the property has a create static function, use it. // eslint-disable-next-line prefer-spread ( _ . has ( this . Type , 'create' ) ? this . Type . create . apply ( this . Type , arguments ) : new this . Type ( item ) ) ) ; }
Add an item or item definition to this list.

@param {Object|PropertyList.Type} item
@todo
- remove item from original parent if already it has a parent
- validate that the original parent's constructor matches this parent's constructor
Add an item or item definition to this list .