@latticehr/scim-query-filter-parser
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Build Status

preface

This library was forked from scim-query-filter-parser.

tl;dr

import { compileFilter, compileSorter } from "scim-query-filter-parser";

const results = [{ userName: "somebody123" }, { userName: "somebody456" }]
  .filter(compileFilter('userName eq "somebody123"'))
  .sort(compileSorter("userName"));

Description

This implements a parser and compiler for the filtering, sorting, and path features defined in System for Cross-Domain Identity Management (SCIM) Protocol 2.0. It was originally built for use by AuthX;

Methods & Properties

compileFilter(input: string): (data: any) => boolean

Compile a SCIM filter expression into a function.

compileSorter(input: string): (a: any, b: any) => -1 | 0 | 1

Compile a SCIM sort expression into a function.

compilePath(input: string): { path: string, filter?: Expression, subpath?: string }

Compile a SCIM PATCH path into a path, with an optional subpath and filter expression function. The subpath will only be present if there's a filter separating it from the path. Otherwise, the path includes the subpath. The compiled path may then be used to differentiate paths with or without filters, subpaths, etc.

/@latticehr/scim-query-filter-parser/

    Package Sidebar

    Install

    npm i @latticehr/scim-query-filter-parser

    Weekly Downloads

    31

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    202 kB

    Total Files

    103

    Last publish

    Collaborators

    • frable
    • ekosz
    • hanford