lib/group.js
function handleErrors(group, val) {
  if (utils.isObject(val)) {
    var List = group.List;
    var keys = Object.keys(List.prototype);

    keys.forEach(function(key) {
      if (typeof val[key] !== 'undefined') return;

      utils.define(val, key, function() {
        throw new Error(key + ' can only be used with an array of `List` items.');
      });
    });
  }
}
function handleErrors(group, val) {
  if (utils.isObject(val)) {
    var List = group.List;
    var keys = Object.keys(List.prototype);

    keys.forEach(function(key) {
      if (typeof val[key] !== 'undefined') return;

      utils.define(val, key, function() {
        throw new Error(key + ' can only be used with an array of `List` items.');
      });
    });
  }
}
function handleErrors ( group , val ) { if ( utils . isObject ( val ) ) { var List = group . List ; var keys = Object . keys ( List . prototype ) ; keys . forEach ( function ( key ) { if ( typeof val [ key ] !== 'undefined' ) return ; utils . define ( val , key , function ( ) { throw new Error ( key + ' can only be used with an array of `List` items.' ) ; } ) ; } ) ; } }
When `get` returns a non-Array object, we decorate
noop `List` methods onto the object to throw errors when list methods
are used, since list array methods do not work on groups.

@param {Object} `group`
@param {Object} `val` Value returned from `group.get()`
When get returns a non - Array object we decorate noop List methods onto the object to throw errors when list methods are used since list array methods do not work on groups .