UNPKG

@paroicms/server

Version:
10 lines 454 B
import { type } from "arktype"; import { truncExcerptToWord } from "../../helpers/excerpt.helpers.js"; const StringOrUndefinedOrNullAT = type("string|undefined|null"); const NumberAT = type("number"); export function makeExcerptLiquidFilter(value, { args }) { const text = StringOrUndefinedOrNullAT.assert(value) ?? ""; const limit = NumberAT.assert(args[0]); return truncExcerptToWord(text, limit); } //# sourceMappingURL=make-excerpt.js.map