
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@looker/filter-expressions
Advanced tools
This TypeScript package provides the necessary functions for transforming [Looker filter expressions](https://cloud.google.com/looker/docs/reference/filter-expressions) into data structures and localized text summaries – and vice versa.
This TypeScript package provides the necessary functions for transforming Looker filter expressions into data structures and localized text summaries – and vice versa.
getExpressionType
Returns a valid filter expression type when given the type and field properties of an IDashboardFilter
object as defined in @looker/sdk
.
getExpressionType({ field: { is_numeric: true }, type: 'field_filter' });
// 'number'
parseFilterExpression
Returns an Abstract Syntax Tree (AST) that logically represents the filter expression string passed in, as well as the filter expression type (and optional user attributes).
parseFilterExpression('number', '[0,20],>30');
// {
// type: ',',
// left: {
// type: 'between',
// bounds: '[]',
// low: 0,
// high: 20,
// is: true,
// },
// right: {
// is: true,
// type: '>',
// value: [30],
// },
// }
summary
The summary
function returns a localized, human-readable summary of a filter expression, given the expression's type, the expression itself, and the user attributes and field, if applicable.
summary('number', '[0,20],>30');
// 'is in range [0, 20] or is > 30'
typeToGrammar
Returns an object with utility functions and values pertaining to a given expression type:
toString
: a function that converts an AST into an expression of the given typesubTypes
: an array containing the sub-types of the expression type, for example ">", "<", "=", "between", etc, for a number expression typegetFilterTokenItem
Converts an AST to a single item for use in a token (i.e. not advanced) filter.
FAQs
This TypeScript package provides the necessary functions for transforming [Looker filter expressions](https://cloud.google.com/looker/docs/reference/filter-expressions) into data structures and localized text summaries – and vice versa.
The npm package @looker/filter-expressions receives a total of 308 weekly downloads. As such, @looker/filter-expressions popularity was classified as not popular.
We found that @looker/filter-expressions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.