UNPKG

@directus/api

Version:

Directus is a real-time API and App dashboard for managing SQL database content

12 lines (11 loc) 400 B
import { deepMapFilter } from '@directus/utils'; export function filterToFields(filter, collection, schema) { const fields = new Set(); deepMapFilter(filter, ([key, _value], context) => { if (context.leaf && context.field) { fields.add([...context.path, key].join('.')); } return undefined; }, { collection, schema }); return Array.from(fields); }