UNPKG

@enonic/js-utils

Version:
29 lines (24 loc) 466 B
import type {PathMatchDslExpression} from '/lib/xp/node'; interface QueryExpressionPathMatch { pathMatch: PathMatchDslExpression } export function pathMatch( field: string, path: string, minimumMatch?: number, boost?: number, ): QueryExpressionPathMatch { const pathMatch: PathMatchDslExpression = { field, path } if (minimumMatch) { pathMatch.minimumMatch = minimumMatch; } if (boost) { pathMatch.boost = boost; } return { pathMatch }; }