Skip to content

Commit 86cafe0

Browse files
committed
Added custom dePopulate func to dePopulate hook.'
1 parent 585617d commit 86cafe0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/services/de-populate.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ const getItems = require('./get-items');
33
const replaceItems = require('./replace-items');
44
const deleteByDot = require('../common/delete-by-dot');
55

6-
module.exports = function () {
6+
module.exports = function (func) {
77
return context => {
88
const items = getItems(context);
99

1010
(Array.isArray(items) ? items : [items]).forEach(item => {
11+
if (typeof func === 'function') {
12+
func(item)
13+
}
14+
1115
removeProps('_computed', item);
1216
removeProps('_include', item);
1317
delete item._elapsed;

0 commit comments

Comments
 (0)