new PropertyExpression(expression)
Handles searching for information within an object using a property expression.
Parameters:
Name | Type | Description |
---|---|---|
expression |
string | Property path to search in |
Methods
(static) self.contains(data, searchTerm)
Iterates through an objects properties using the specified property expression
and performs a contains comparison.
Parameters:
Name | Type | Description |
---|---|---|
data |
object | Object being searched. An object can be a single object or array |
searchTerm |
string | The text value to find |
Returns:
Array of matched results
(static) self.criteriaFunc(data, func)
Allows a function to be passed in to perform a manual comparison.
Parameters:
Name | Type | Description |
---|---|---|
data |
object | Object being searched. An object can be a single object or array |
func |
function | Function that will be executed after each result is iterated. If this function returns a value, it will be added to the results array. |
Returns:
Array of matched results
(static) self.equals(data, searchTerm)
Iterates through an objects properties using the specifed property expression
and performs an equals comparison.
Parameters:
Name | Type | Description |
---|---|---|
data |
object | Object being searched. An object can be a single object or array |
searchTerm |
string | The text value to find |
Returns:
Array of matched results
(static) self.withinDateRange(data, start, end)
Performs a date range comparison
Parameters:
Name | Type | Description |
---|---|---|
data |
object | Object being searched. An object can be a single object or array |
start |
date | Start date |
end |
date | End date |
Returns:
Array of matched results