UNPKG

rule-filter-validator

Version:

A object and scope validator based on structured rules

15 lines (14 loc) 624 B
import type { Filter } from './types'; /** * This extracts the given field from the passed Filter and returns a new Filter object * that only contains only the given field and its children, if any. * If the input Filter object doesn't have the given field or is neither a FieldFilter nor a LogicalFilter, * the function returns null. * * @param filter Filter * @param field string name of field to extract * @param filterPath (optional) * @param _history (private) * @returns */ export declare function extractFieldFromFilter(filter: Filter, field: string, filterPath?: string, _history?: string): Filter | null;