Class

Filter

(private) Filter(filters, resource)

Filter object wrapping up selected filters.

Constructor

# private new Filter(filters, resource)

Parameters:
Name Type Description
filters Object.<String, (Object|String)>

selected filters

resource BaseResource

resource which is filtered

View Source adminjs/src/backend/utils/filter/filter.ts, line 13

Classes

Filter

Methods

# static normalizeKeys(filters) → {Object}

Changes raw nested filters to form Object<path, value>.

Parameters:
Name Type Description
filters Object

View Source adminjs/src/backend/utils/filter/filter.ts, line 45

Object
Example
const filters = {
 nested: {field: 'ala'},
 'dataField~~from': '2019-08-14'
}

const normalized = Filter.normalizeFilters(filters)
// {
//   'nested.filter': 'ala',
//   'dataField': {from: '2019-08-14'}
// }

# get(key) → {Filter.Property|undefined}

Returns filter for a given property key

Parameters:
Name Type Description
key String

property key

View Source adminjs/src/backend/utils/filter/filter.ts, line 54

Filter.Property | undefined

# async populate()

Populates all filtered properties which refers to other resources

View Source adminjs/src/backend/utils/filter/filter.ts, line 60