This is the filters object that will be used to lookfor filters in expressions. It's a plain JS object soyou can just import it, use its methods as you see fit,add custom filters to it or even overwrite the defaultones.
Converts a hyphenated or underscored string to camel-case.
Converts a given value to a date in a givenformat orthe default one from the config.
Currently the following tokens are supported:
Filters an array by a given value or undefined. If an optional key isgiven as third argument it will try to use that key fromtha array's values.
Converts a camel-cased string to a hyphenated one.
Converts a string to lower-case letters.
Converts a value to number in a optionally give format orthe default one from the config.
The format will be parsed from one of the following orfallback to an integer:
Basically the algorithm is to use any non numeric characterfrom the 2 position in the string as thousands separator ifavailable. The last non numeric character from the end willbe used the decimal point and the number of numeric charactersat the end of the string will be used as precision.
Pads a string on its left side with an optional givencharacter or 0.
Sorts an array. An optional key can be given as second parameterthat will be looked up on the array's values for comparison.A third argument allows for changing the sort order to descending.
Converts a camel-cased string to a underscored one.
Converts a string to upper-case letters.
This module exports the filters object.