rudiment.js
function(doc) {
      if (!this._props) {
        return doc;
      }

      return this._props.reduce(function(obj, prop) {
        if (doc.hasOwnProperty(prop)) {
          obj[prop] = doc[prop];
        }

        return obj;
      }, {});
    }
function(doc) {
      if (!this._props) {
        return doc;
      }

      return this._props.reduce(function(obj, prop) {
        if (doc.hasOwnProperty(prop)) {
          obj[prop] = doc[prop];
        }

        return obj;
      }, {});
    }
function ( doc ) { if ( ! this . _props ) { return doc ; } return this . _props . reduce ( function ( obj , prop ) { if ( doc . hasOwnProperty ( prop ) ) { obj [ prop ] = doc [ prop ] ; } return obj ; } , { } ) ; }
Remove extraneous properties from a proposed document

@param {Object} doc - a document to clean
@return {Object} a copy of the cleaned document
Remove extraneous properties from a proposed document