How to use the cspell-util-bundle.xregexp.replace function in cspell-util-bundle

To help you get started, we’ve selected a few cspell-util-bundle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github streetsidesoftware / cspell / packages / cspell-tools / src / compiler / text.ts View on Github external
export function splitCamelCaseWord(word: string): string[] {
    const wPrime = word.replace(regExUpperSOrIng, s => s[0] + s.substr(1).toLowerCase());
    const separator = '_<^*_*^>_';
    const pass1 = XRegExp.replace(wPrime, regExSplitWords, '$1' + separator + '$2');
    const pass2 = XRegExp.replace(pass1, regExSplitWords2, '$1' + separator + '$2');
    return XRegExp.split(pass2, separator);
}
github streetsidesoftware / cspell / packages / cspell-lib / src / util / text.ts View on Github external
export function splitCamelCaseWord(word: string): string[] {
    const wPrime = word.replace(regExUpperSOrIng, s => s[0] + s.substr(1).toLowerCase());
    const separator = '_<^*_*^>_';
    const pass1 = XRegExp.replace(wPrime, regExSplitWords, '$1' + separator + '$2');
    const pass2 = XRegExp.replace(pass1, regExSplitWords2, '$1' + separator + '$2');
    return XRegExp.split(pass2, separator);
}
github streetsidesoftware / cspell / packages / cspell-lib / src / util / text.ts View on Github external
export function splitCamelCaseWord(word: string): string[] {
    const wPrime = word.replace(regExUpperSOrIng, s => s[0] + s.substr(1).toLowerCase());
    const separator = '_<^*_*^>_';
    const pass1 = XRegExp.replace(wPrime, regExSplitWords, '$1' + separator + '$2');
    const pass2 = XRegExp.replace(pass1, regExSplitWords2, '$1' + separator + '$2');
    return XRegExp.split(pass2, separator);
}
github streetsidesoftware / cspell / packages / cspell-tools / src / compiler / text.ts View on Github external
export function splitCamelCaseWord(word: string): string[] {
    const wPrime = word.replace(regExUpperSOrIng, s => s[0] + s.substr(1).toLowerCase());
    const separator = '_<^*_*^>_';
    const pass1 = XRegExp.replace(wPrime, regExSplitWords, '$1' + separator + '$2');
    const pass2 = XRegExp.replace(pass1, regExSplitWords2, '$1' + separator + '$2');
    return XRegExp.split(pass2, separator);
}
github streetsidesoftware / cspell / packages / cspell-lib / src / util / text.ts View on Github external
.map(({ text, offset }) => ({
            text: XRegExp.replace(text, regExIgnoreCharacters, (match: string) => ' '.repeat(match.length)),
            offset,
        }))
        .concatMap(wo => matchToTextOffset(reg2, wo))

cspell-util-bundle

This is a bundle of external libraries used by cspell bundled into a single `.js`

MIT
Latest version published 4 years ago

Package Health Score

69 / 100
Full package analysis

Similar packages