Skip to content

getLfNormalizedOffsetToOriginalOffsetMapper

Returns a function that maps LF-normalized offsets to original offsets.

Import:

import { getLfNormalizedOffsetToOriginalOffsetMapper } from 'obsidian-dev-utils/string';

Signature:

function getLfNormalizedOffsetToOriginalOffsetMapper(str: string): (lfOffset: number) => number

Parameters:

ParameterTypeDescription
strstringThe string to get the LF-normalized indices from.

Returns: (lfOffset: number) => number — A function that maps LF-normalized offsets to original offsets.