import { Visitor } from "./visitor" ; import { filter , query } from "odata-v4-parser" ; import { Token } from "odata-v4-parser/lib/lexer" ; param { string } queryString return { Visitor } example export function createQuery ( odataQuery ) ; export function createQuery ( odataQuery ) ; export function createQuery ( odataQuery ) { let ast = < Token > ( typeof odataQuery == "string" ? query ( < string > odataQuery ) : odataQuery ) ; return new Visitor ( ) . Visit ( ast ) ; } param { string } odataFilter return { Object } example export function createFilter ( odataFilter ) ; export function createFilter ( odataFilter ) ; export function createFilter ( odataFilter ) { let context = { query : { } } ; let ast = < Token > ( typeof odataFilter == "string" ? filter ( < string > odataFilter ) : odataFilter ) ; new Visitor ( ) . Visit ( ast , context ) ; return context . query ; }