mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Add permission variables support
This commit is contained in:
7
api/src/utils/deep-map.ts
Normal file
7
api/src/utils/deep-map.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { transform, isPlainObject } from 'lodash';
|
||||
|
||||
export function deepMap(obj: Record<string, any>, iterator: Function, context?: Function) {
|
||||
return transform(obj, function(result: any, val, key) {
|
||||
result[key] = isPlainObject(val) ? deepMap(val, iterator, context) : iterator.call(context, val, key, obj)
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user