Class ExpressionBuilder<T, Path, TCurr>

Source

Constructors§

Source§

new ExpressionBuilder<
    T extends ChainContext = any,
    Path extends string = any,
    TCurr = TypeOfField<Path, T>,
>(
    path: Path,
    methodCalls?: string[],
    options?: ExpressionBuilderOptions,
): ExpressionBuilder<T, Path, TCurr>

Properties§

Source§

filter: TCurr extends TElem[]
    ? (predicate: (item: TElem) => boolean) => this
    : "Expected array " = ...

Source§

find: TCurr extends TElem[]
    ? (
        predicate: (item: TElem) => boolean,
    ) => ExpressionBuilder<T, `${Path}[${number}]`>
    : "Expected array " = ...

Source§

first: TCurr extends any[]
    ? () => ExpressionBuilder<T, `${Path}[${number}]`>
    : "Expected array " = ...

Source§

join: TCurr extends any[]
    ? (
        separator: string,
    ) => ExpressionBuilder<any, any, string>
    : "Expected array " = ...

Source§

last: TCurr extends any[]
    ? () => ExpressionBuilder<T, `${Path}[${number}]`>
    : "Expected array " = ...

Source§

split: TCurr extends string
    ? (
        separator: string,
    ) => ExpressionBuilder<any, any, string[]>
    : "Expected string " = ...

Source§

toJsonString: () => this = ...

Source§

toLowerCase: TCurr extends string ? () => this : "Expected string " = ...

Source§

toUpperCase: TCurr extends string ? () => this : "Expected string " = ...

Source§

trim: TCurr extends string ? () => this : "Expected string " = ...

Source§

public readonly type: TCurr = ...

The type of the current field Should only be used with typeof Returns null.

Methods§

Source§

call(
    methodName: string,
    ...args: any[],
): ExpressionBuilder<T, any>

Arbitrary method call

Source§

format(): string

Source§

getFullPath(): Path

Source§

getNodeId(): string

Source§

getPath(): string

Source§

mode(mode: "item"): this

Source§

noQuotes(value?: boolean): this

Source§

prefix(prefix: ExpressionPrefix): this

Source§

prop<P>(
    propertyName: P,
): ExpressionBuilder<T, `${Path}${P}`>

Source§

toExpression(): string

return ={{ format() }}

Source§

toJSON(): string