Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const feathersErrors = require('@feathersjs/errors');
const errors = feathersErrors.errors;
module.exports = function (target, options) {
options = Object.assign({}, options);
console.error(
'Calling populate(target, options) is now DEPRECATED and will be removed in the future. ' +
'Refer to docs.feathersjs.com for more information. (populate-legacy)'
);
if (!options.service) {
throw new Error('You need to provide a service. (populate)');
}
const field = options.field || target;
return function (hook) {