UNPKG

string-find-heads-tails

Version:

Finds where are arbitrary templating marker heads and tails located

33 lines (31 loc) 844 B
declare const version: string; interface Opts { fromIndex: number; throwWhenSomethingWrongIsDetected: boolean; allowWholeValueToBeOnlyHeadsOrTails: boolean; source: string; matchHeadsAndTailsStrictlyInPairsByTheirOrder: boolean; relaxedAPI: boolean; } declare const defaults: { fromIndex: number; throwWhenSomethingWrongIsDetected: boolean; allowWholeValueToBeOnlyHeadsOrTails: boolean; source: string; matchHeadsAndTailsStrictlyInPairsByTheirOrder: boolean; relaxedAPI: boolean; }; interface ResObj { headsStartAt: number; headsEndAt: number; tailsStartAt: number; tailsEndAt: number; } declare function strFindHeadsTails( str: string, heads: string | string[], tails: string | string[], opts?: Partial<Opts>, ): ResObj[]; export { defaults, strFindHeadsTails, version }; export type { Opts, ResObj };