function remove() {
	  for (var _len4 = arguments.length, fields = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
	    fields[_key4] = arguments[_key4];
	  }

	  var removeFields = function removeFields(data) {
	    var _iteratorNormalCompletion3 = true;
	    var _didIteratorError3 = false;
	    var _iteratorError3 = undefined;

	    try {
	      for (var _iterator3 = fields[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
	        var field = _step3.value;

	        var value = (0, _utils.getByDot)(data, field);
	        if (value !== undefined) {
	          // prevent setByDot creating nested empty objects
	          (0, _utils.setByDot)(data, field, undefined, true);
	        }
	      }
	    } catch (err) {
	      _didIteratorError3 = true;
	      _iteratorError3 = err;
	    } finally {
	      try {
	        if (!_iteratorNormalCompletion3 && _iterator3.return) {
	          _iterator3.return();
	        }
	      } finally {
	        if (_didIteratorError3) {
	          throw _iteratorError3;
	        }
	      }
	    }
	  };

	  // when deprecating, remember hook should not run if called from server
	  var callback = function callback(hook) {
	    return !!hook.params.provider;
	  }; // important condition
	  if (typeof fields[fields.length - 1] === 'function') {
	    callback = fields.pop();
	  }

	  return function (hook) {
	    var result = hook.type === 'before' ? hook.data : hook.result;
	    var update = function update(condition) {
	      if (result && condition) {
	        if (Array.isArray(result)) {
	          result.forEach(removeFields);
	        } else {
	          removeFields(result);

	          if (result.data) {
	            if (Array.isArray(result.data)) {
	              result.data.forEach(removeFields);
	            } else {
	              removeFields(result.data);
	            }
	          }
	        }
	      }
	      return hook;
	    };

	    var check = callback(hook);

	    return check && typeof check.then === 'function' ? check.then(update) : update(check);
	  };
	}
/**
	 * Remove the given 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)
	 *
	 * 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.
	 */
Remove the given 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.
Remove the given 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 remove() {
	  for (var _len4 = arguments.length, fields = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
	    fields[_key4] = arguments[_key4];
	  }
	  var removeFields = function removeFields(data) {
	    var _iteratorNormalCompletion3 = true;
	    var _didIteratorError3 = false;
	    var _iteratorError3 = undefined;
	    try {
	      for (var _iterator3 = fields[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
	        var field = _step3.value;
	        var value = (0, _utils.getByDot)(data, field);
	        if (value !== undefined) {
	          (0, _utils.setByDot)(data, field, undefined, true);
	        }
	      }
	    } catch (err) {
	      _didIteratorError3 = true;
	      _iteratorError3 = err;
	    } finally {
	      try {
	        if (!_iteratorNormalCompletion3 && _iterator3.return) {
	          _iterator3.return();
	        }
	      } finally {
	        if (_didIteratorError3) {
	          throw _iteratorError3;
	        }
	      }
	    }
	  };
	  var callback = function callback(hook) {
	    return !!hook.params.provider;
	  }; 
	  if (typeof fields[fields.length - 1] === 'function') {
	    callback = fields.pop();
	  }
	  return function (hook) {
	    var result = hook.type === 'before' ? hook.data : hook.result;
	    var update = function update(condition) {
	      if (result && condition) {
	        if (Array.isArray(result)) {
	          result.forEach(removeFields);
	        } else {
	          removeFields(result);
	          if (result.data) {
	            if (Array.isArray(result.data)) {
	              result.data.forEach(removeFields);
	            } else {
	              removeFields(result.data);
	            }
	          }
	        }
	      }
	      return hook;
	    };
	    var check = callback(hook);
	    return check && typeof check.then === 'function' ? check.then(update) : update(check);
	  };
	}
function remove ( ) { for ( var _len4 = arguments . length , fields = Array ( _len4 ) , _key4 = 0 ; _key4 < _len4 ; _key4 ++ ) { fields [ _key4 ] = arguments [ _key4 ] ; } var removeFields = function removeFields ( data ) { var _iteratorNormalCompletion3 = true ; var _didIteratorError3 = false ; var _iteratorError3 = undefined ; try { for ( var _iterator3 = fields [ Symbol . iterator ] ( ) , _step3 ; ! ( _iteratorNormalCompletion3 = ( _step3 = _iterator3 . next ( ) ) . done ) ; _iteratorNormalCompletion3 = true ) { var field = _step3 . value ; var value = ( 0 , _utils . getByDot ) ( data , field ) ; if ( value !== undefined ) { ( 0 , _utils . setByDot ) ( data , field , undefined , true ) ; } } } catch ( err ) { _didIteratorError3 = true ; _iteratorError3 = err ; } finally { try { if ( ! _iteratorNormalCompletion3 && _iterator3 . return ) { _iterator3 . return ( ) ; } } finally { if ( _didIteratorError3 ) { throw _iteratorError3 ; } } } } ; var callback = function callback ( hook ) { return ! ! hook . params . provider ; } ; if ( typeof fields [ fields . length - 1 ] === 'function' ) { callback = fields . pop ( ) ; } return function ( hook ) { var result = hook . type === 'before' ? hook . data : hook . result ; var update = function update ( condition ) { if ( result && condition ) { if ( Array . isArray ( result ) ) { result . forEach ( removeFields ) ; } else { removeFields ( result ) ; if ( result . data ) { if ( Array . isArray ( result . data ) ) { result . data . forEach ( removeFields ) ; } else { removeFields ( result . data ) ; } } } } return hook ; } ; var check = callback ( hook ) ; return check && typeof check . then === 'function' ? check . then ( update ) : update ( check ) ; } ; }
Remove the given fields either from the data submitted (as a before hook for create,
 update or patch) or from the result (as an after hook).
Remove the given 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 // important condition