function pluck() {
	  for (var _len5 = arguments.length, fields = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
	    fields[_key5] = arguments[_key5];
	  }

	  var pluckFields = function pluckFields(data) {
	    var plucked = {};

	    fields.forEach(function (field) {
	      var value = (0, _utils.getByDot)(data, field);
	      if (value !== undefined) {
	        // prevent setByDot creating nested empty objects
	        (0, _utils.setByDot)(plucked, field, value);
	      }
	    });

	    return plucked;
	  };

	  // when deprecating, remember hook should not run if called from server
	  var callback = function callback(hook) {
	    return !!hook.params.provider;
	  };
	  if (typeof fields[fields.length - 1] === 'function') {
	    callback = fields.pop();
	    console.error('DEPRECATED Predicate func will be removed next version. (pluck)');
	  }

	  return function (hook) {
	    var update = function update(condition) {
	      if (condition) {
	        var items = (0, _utils.getItems)(hook);

	        if (items) {
	          if (Array.isArray(items)) {
	            (0, _utils.replaceItems)(hook, items.map(pluckFields));
	          } else {
	            (0, _utils.replaceItems)(hook, pluckFields(items));
	          }
	        }
	      }

	      return hook;
	    };

	    var check = callback(hook);

	    return check && typeof check.then === 'function' ? check.then(update) : update(check);
	  };
	}
/**
	 * Discard all other fields except for the provided fields either from the data submitted
	 * (as a before hook for create, update or patch) or from the result (as an after hook).
	 * If the data is an array or a paginated find result the hook will remove the field for every item.
	 *
	 * @param {Array.<string|Function>} fields - Field names to remove. Dot notation is supported.
	 * @returns {Function} hook function(hook)
	 *
	 * DEPRECATED: The last param may be a function to determine if the current hook should be updated.
	 * Its signature is func(hook) and it returns either a boolean or a promise resolving to a boolean.
	 * This boolean determines if the hook is updated.
	 *
	 * hooks.lowerCase('group', hook => hook.data.status === 1);
	 * hooks.lowerCase('group', hook => new Promise(resolve => {
	 *   setTimeout(() => { resolve(true); }, 100)
	 * }));
	 *
	 * The items are only updated for external requests, e.g. hook.params.provider is rest or socketio,
	 * or if the decision function mentioned above returns true.
	 */
Discard all other fields except for the provided fields either from the data submitted
(as a before hook for create, update or patch) or from the result (as an after hook).
If the data is an array or a paginated find result the hook will remove the field for every item.

@param {Array.} fields - Field names to remove. Dot notation is supported.

The last param may be a function to determine if the current hook should be updated.
Its signature is func(hook) and it returns either a boolean or a promise resolving to a boolean.
This boolean determines if the hook is updated.



The items are only updated for external requests, e.g. hook.params.provider is rest or socketio,
or if the decision function mentioned above returns true.
Discard all other fields except for the provided fields either from the data submitted ( as a before hook for create update or patch ) or from the result ( as an after hook ) . If the data is an array or a paginated find result the hook will remove the field for every item . @param { Array . } fields - Field names to remove . Dot notation is supported . The last param may be a function to determine if the current hook should be updated . Its signature is func ( hook ) and it returns either a boolean or a promise resolving to a boolean . This boolean determines if the hook is updated . The items are only updated for external requests e . g . hook . params . provider is rest or socketio or if the decision function mentioned above returns true .
function pluck() {
	  for (var _len5 = arguments.length, fields = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
	    fields[_key5] = arguments[_key5];
	  }
	  var pluckFields = function pluckFields(data) {
	    var plucked = {};
	    fields.forEach(function (field) {
	      var value = (0, _utils.getByDot)(data, field);
	      if (value !== undefined) {
	        (0, _utils.setByDot)(plucked, field, value);
	      }
	    });
	    return plucked;
	  };
	  var callback = function callback(hook) {
	    return !!hook.params.provider;
	  };
	  if (typeof fields[fields.length - 1] === 'function') {
	    callback = fields.pop();
	    console.error('DEPRECATED Predicate func will be removed next version. (pluck)');
	  }
	  return function (hook) {
	    var update = function update(condition) {
	      if (condition) {
	        var items = (0, _utils.getItems)(hook);
	        if (items) {
	          if (Array.isArray(items)) {
	            (0, _utils.replaceItems)(hook, items.map(pluckFields));
	          } else {
	            (0, _utils.replaceItems)(hook, pluckFields(items));
	          }
	        }
	      }
	      return hook;
	    };
	    var check = callback(hook);
	    return check && typeof check.then === 'function' ? check.then(update) : update(check);
	  };
	}
function pluck ( ) { for ( var _len5 = arguments . length , fields = Array ( _len5 ) , _key5 = 0 ; _key5 < _len5 ; _key5 ++ ) { fields [ _key5 ] = arguments [ _key5 ] ; } var pluckFields = function pluckFields ( data ) { var plucked = { } ; fields . forEach ( function ( field ) { var value = ( 0 , _utils . getByDot ) ( data , field ) ; if ( value !== undefined ) { ( 0 , _utils . setByDot ) ( plucked , field , value ) ; } } ) ; return plucked ; } ; var callback = function callback ( hook ) { return ! ! hook . params . provider ; } ; if ( typeof fields [ fields . length - 1 ] === 'function' ) { callback = fields . pop ( ) ; console . error ( 'DEPRECATED Predicate func will be removed next version. (pluck)' ) ; } return function ( hook ) { var update = function update ( condition ) { if ( condition ) { var items = ( 0 , _utils . getItems ) ( hook ) ; if ( items ) { if ( Array . isArray ( items ) ) { ( 0 , _utils . replaceItems ) ( hook , items . map ( pluckFields ) ) ; } else { ( 0 , _utils . replaceItems ) ( hook , pluckFields ( items ) ) ; } } } return hook ; } ; var check = callback ( hook ) ; return check && typeof check . then === 'function' ? check . then ( update ) : update ( check ) ; } ; }
Discard all other fields except for the provided fields either from the data submitted
 (as a before hook for create, update or patch) or from the result (as an after hook).
Discard all other fields except for the provided fields either from the data submitted ( as a before hook for create update or patch ) or from the result ( as an after hook ) .
// prevent setByDot creating nested empty objects // when deprecating, remember hook should not run if called from server