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 admin-bro/src/backend/utils/filter/filter.ts, line 13

Classes

Methods

# static normalizeKeys(filters) → {Object}

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

Parameters:
Name Type Description
filters Object

View Source admin-bro/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 admin-bro/src/backend/utils/filter/filter.ts, line 54

Filter.Property | undefined

# async populate()

Populates all filtered properties which refers to other resources

View Source admin-bro/src/backend/utils/filter/filter.ts, line 60

SoftwareBrothers

Proudly built and maintained by SoftwareBrothers

Software House with a passion for both JavaScript and TypeScript.

See what we do See what we believe in

Proudly built and maintained by

SoftwareBrothers