Constructor
# private new Filter(filters, resource)
Parameters:
Name | Type | Description |
---|---|---|
filters |
Object.<String, (Object|String)> | selected filters |
resource |
BaseResource | resource which is filtered |
Classes
Filter
See DetailsMethods
# static normalizeKeys(filters) → {Object}
Changes raw nested filters to form Object<path, value>.
Parameters:
Name | Type | Description |
---|---|---|
filters |
Object |
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 |
Filter.Property
|
undefined
# async populate()
Populates all filtered properties which refers to other resources