Package detail

regexp-helper-core

bluelovers14.3kMIT2.0.10

regexp-helper-core

check, es2018, esnext, flag

readme

regexp-helper-core

API

index.d.ts

export declare const REGEXP_TO_STRING_TAG: string;
export declare function toHex(n: number, toUpperCase?: boolean): string;
/**
 * @code
 * console.log(core.toUnicode('𠮷')); // => \u{20bb7}
 * console.log(core.toUnicode('𠮷'.codePointAt(0)));
 *
 * console.log(core.toUnicode('𠮷', true)); // => \ud842\udfb7
 * console.log(core.toUnicode('𠮷'.codePointAt(0), true));
 *
 * /[𠮷]/u.test('𠮷')
 * /[\u{20bb7}]/u.test('𠮷')
 * /[\ud842\udfb7]/u.test('𠮷')
 */
export declare function toUnicode(charCode: number | string, noMerge?: boolean, wrap?: boolean): string;
export declare function _toUnicode(charCode: number, wrap?: boolean): string;
export declare function isDoubleUnicode(str: string): boolean;
export declare function isRegExp<T extends RegExp>(r: T): T & RegExp;
export declare function isRegExp(r: RegExp): r is RegExp;
export declare function isRegExp(r: any): RegExp | null;
/**
 * @link https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
 * @link https://github.com/ikatyang/regexp-util/blob/7810ce61ff8becd728b745eb6d5c1ca76adfebe0/src/charset.ts#L289
 *
 * @code
 * surrogatePair('𠮷'.codePointAt(0)) // => { h: 55362, l: 57271 }
 * console.log('𠮷'.charCodeAt(0), '𠮷'.charCodeAt(1)) // => 55362 57271
 */
export declare function surrogatePair(codepoint: number): [number, number] & {
    h: number;
    l: number;
};
/**
 * https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
 *
 * @code
 * unicodeUnEscape('\\u{48}\\u{65}\\u{6c}\\u{6c}\\u{6f}\\u{20}\\u{77}\\u{6f}\\u{72}\\u{6c}\\u{64}') // => 'Hello world'
 * unicodeUnEscape('\\u{20bb7}') // => '𠮷'
 */
export declare function unicodeUnEscape(string: string, noLeadingSolidus?: boolean): string;
/**
 * @code
 * unicodeEscape('𠮷') // => '\\u{20bb7}'
 */
export declare function unicodeEscape(string: string, noLeadingSolidus?: boolean, noMerge?: boolean, noWrap?: boolean, filter?: RegExp): string;
import * as self from './index';
declare const _default: Readonly<typeof self>;
export default _default;

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

2.0.10 (2024-08-24)

🛠 Build System

2.0.9 (2024-03-01)

📌 Dependencies

2.0.8 (2024-01-29)

🔖 Miscellaneous

2.0.7 (2023-02-28)

♻️ Chores

🔖 Miscellaneous

2.0.6 (2023-02-28)

♻️ Chores

🔖 Miscellaneous

2.0.5 (2023-02-28)

♻️ Chores

🔖 Miscellaneous

2.0.4 (2023-02-28)

♻️ Chores

🔖 Miscellaneous

2.0.3 (2023-02-28)

♻️ Chores

2.0.2 (2022-10-26)

📦 Code Refactoring

🔖 Miscellaneous

2.0.1 (2022-10-26)

📦 Code Refactoring

🔖 Miscellaneous

1.0.20 (2022-10-16)

📚 Documentation

🚨 Tests

📌 Dependencies

1.0.19 (2021-08-13)

♻️ Chores

1.0.18 (2021-06-21)

💎 Styles

♻️ Chores

🔖 Miscellaneous

1.0.17 (2021-06-21)

💎 Styles

♻️ Chores

🔖 Miscellaneous

1.0.16 (2021-06-21)

💎 Styles

♻️ Chores

1.0.15 (2021-02-04)

🔖 Miscellaneous

1.0.14 (2021-02-04)

🔖 Miscellaneous

1.0.13 (2020-11-10)

🔖 Miscellaneous

1.0.12 (2020-11-10)

♻️ Chores

1.0.11 (2020-07-27)

♻️ Chores

1.0.10 (2020-06-09)

Note: Version bump only for package regexp-helper-core

1.0.9 (2020-06-08)

Note: Version bump only for package regexp-helper-core

1.0.8 (2020-05-22)

Note: Version bump only for package regexp-helper-core