par

@odata/parser

OData(V4) URI Parser

Showing:

Popularity

Downloads/wk

1.5K

GitHub Stars

8

Maintenance

Last Commit

1mo ago

Contributors

9

Package

Dependencies

2

License

MIT

Type Definitions

Built-In

Tree-Shakeable

No?

Categories

Readme

OData(V4) URI Parser

npm (scoped) GitHub Workflow Status Codecov

OData v4 parser based on OASIS Standard OData v4 ABNF grammar

Usage - URI Parser

import { defaultParser } from "@odata/parser";
const ast = defaultParser.odataUri("/Categories(10)?$expand=A,C&$select=D,E")
// process it

Usage - OData QueryParam/Filter Builder

import { param, filter } from "@odata/parser";
param().top(1).filter(filter({ A: 1 }))
// => $top=1&$filter=A eq 1

filter with type

import { filter, literalValues } from "@odata/parser";

expect(filter({ A: 1 }).build())
    .toBe("A eq 1")
expect(filter({ A: literalValues.String(1) }).build())
    .toBe("A eq '1'")
expect(filter({ A: literalValues.Guid("253f842d-d739-41b8-ac8c-139ac7a9dd14") }).build())
    .toBe("A eq 253f842d-d739-41b8-ac8c-139ac7a9dd14")

CHANGELOG

LICENSE

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100