Package detail

@odata/parser

Soontao38.7kMIT0.2.14

OData(V4) Parser

odata, odata(v4), uri parser

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

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

0.2.14 (2023-03-23)

0.2.13 (2023-03-23)

Bug Fixes

  • double quote in filter (6f5ec49)
  • general values in string literal (653db44)

0.2.12 (2022-11-15)

Bug Fixes

0.2.11 (2022-04-05)

Features

Bug Fixes

0.2.10 (2021-08-16)

Features

0.2.9 (2021-07-07)

0.2.8 (2021-07-02)

0.2.7 (2021-06-23)

0.2.6 (2021-06-20)

Features

  • support filter with type (81d6cc7)

Bug Fixes

0.2.5 (2021-04-19)

Bug Fixes

0.2.4 (2021-03-24)

Features

  • support uppper case 'POLYGON' (752c6e1)

0.2.3 (2020-09-23)

0.2.2 (2020-09-23)

Features

  • add odata method constants (aaf8ce6)

0.2.1 (2020-08-26)

0.1.46 (2020-08-26)

Bug Fixes

0.1.45 (2020-08-26)

Bug Fixes

0.1.44 (2020-08-24)

0.1.43 (2020-08-10)

Bug Fixes

0.1.42 (2020-08-10)

Features

0.1.41 (2020-08-09)

Features

  • type for batch request for odata 4.01 (88e5bf2)

0.1.40 (2020-08-01)

0.1.39 (2020-07-30)

Features

0.1.38 (2020-07-10)

Bug Fixes

  • visit undefine object will throw error (8c37045)

0.1.37 (2020-07-10)

Features

  • visitor: support parent (2824438)

0.1.36 (2020-07-09)

Features

  • visitor: deep first traverse (8bd49bf)

0.1.35 (2020-07-09)

Features

  • visitor: add ast visitor (0ff94c3)

0.1.34 (2020-07-09)

0.1.33 (2020-07-09)

0.1.32 (2020-07-06)

0.1.31 (2020-07-06)

Features