This library, `scim-query-filter-parser`, provides a robust parser and compiler for the System for Cross-Domain Identity Management (SCIM) Protocol 2.0. Specifically, it enables the processing of SCIM filtering (RFC 7644, section 3.4.2.2) and sorting (RFC 7644, section 3.4.2.3) expressions. It takes a SCIM filter or sort string as input and compiles it into a standard JavaScript function that can be used directly with array `filter` or `sort` methods, respectively. The current stable version is 2.0.4. While a specific release cadence isn't explicitly stated, the project appears actively maintained given its versioning and clear use case. A key differentiator is its direct implementation of RFC 7644 standards, originally built for `AuthX`, offering a specialized solution for SCIM-compliant identity management systems.
npm install scim-query-filter-parserVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import `compileFilter` and `compileSorter` and use them to filter and sort an array of objects based on SCIM query strings, including complex filters and extended attributes.
Prefer `import` statements for consuming the library. If using CommonJS, ensure your bundler or Node.js environment correctly resolves the `main` entry point. Test existing `require` statements thoroughly after upgrading.
Validate SCIM query strings before passing them to the compiler functions. Refer to RFC 7644, sections 3.4.2.2 (filtering) and 3.4.2.3 (sorting) for correct syntax. Implement robust error handling around calls to `compileFilter` and `compileSorter`.
Cache the results of `compileFilter` and `compileSorter` if the filter or sort string is static or frequently reused. Avoid recompiling the same string multiple times within a tight loop. For extremely high-performance scenarios with huge datasets, consider pre-filtering or indexing strategies.
Use `import { symbol } from 'package';` instead of `const { symbol } = require('package');` in modern JavaScript or TypeScript environments. Ensure your `package.json` has `"type": "module"` if your files are ESM, or configure your bundler (e.g., Webpack, Rollup) to correctly handle dual packages.Verify the exact import statement: `import { compileFilter } from 'scim-query-filter-parser';`. If using `require`, ensure it's `const { compileFilter } = require('scim-query-filter-parser');` and not `const compileFilter = require('scim-query-filter-parser');`.Carefully review the provided filter or sort string against RFC 7644 section 3.4.2.2 and 3.4.2.3. Common mistakes include mismatched quotes, incorrect logical operators (e.g., `and` vs `&&`), invalid attribute names, or improper use of comparison operators.
No dependency data recorded yet.