A parser and evaluator for RFC 7643 SCIM 2.0 filter syntax. Version 0.2.0 allows parsing filter expressions into an AST and applying them as JavaScript functions to filter JSON objects. Supports operators (eq, co, sw, pr, gt, ge, lt, le, and, or, not) and complex filters with attribute paths and value filters. Lightweight, dependency-free, and ESM-only. No TypeScript types provided. Differentiates from generic query parsers by adhering strictly to SCIM 2.0 filtering grammar.
npm install scim2-filterVerified import paths — ran on the pinned version, not inferred.
Parses a SCIM 2.0 filter string into an AST, then uses the filter function to evaluate the expression against an array of objects.
Install @types/scim2-filter if available or add a declaration file manually. Alternatively, use JSDoc comments for type hints.
Ensure input data consists of plain JavaScript objects.
Validate filter syntax and implement additional attribute handling as needed.
Check the package source for supported operators; consider contributing missing features.
Add "type": "module" to package.json or use .mjs extension for importing file.
Use `import { parse } from 'scim2-filter'` instead of `import parse from 'scim2-filter'` or `const parse = require('scim2-filter')`.Ensure the result of `filter(parse(...))` is a function; use it as a callback to `Array.filter()`.
No dependency data recorded yet.