UNPKG

string-range-expander

Version:

Expands string index ranges within whitespace boundaries until letters are met

23 lines (20 loc) 725 B
type Range = | [from: number, to: number] | [from: number, to: number, whatToInsert: string | null | undefined]; declare const version: string; interface Opts { str: string; from: number; to: number; ifLeftSideIncludesThisThenCropTightly: string; ifLeftSideIncludesThisCropItToo: string; ifRightSideIncludesThisThenCropTightly: string; ifRightSideIncludesThisCropItToo: string; extendToOneSide: false | "left" | "right"; wipeAllWhitespaceOnLeft: boolean; wipeAllWhitespaceOnRight: boolean; addSingleSpaceToPreventAccidentalConcatenation: boolean; } declare const defaults: Opts; declare function expander(opts: Partial<Opts>): Range; export { type Opts, type Range, defaults, expander, version };