From 5fe21e8c1b37a06eea9df599c681cb3eb322901c Mon Sep 17 00:00:00 2001 From: Steven Levithan Date: Thu, 7 Nov 2024 20:25:36 +0100 Subject: [PATCH] Tweaks --- README.md | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ca5ebf4..271f82e 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ A lightweight **Oniguruma to JavaScript RegExp transpiler** that runs in the bro - Run regexes intended for Oniguruma in JavaScript, such as those used in TextMate grammars (used by VS Code, [Shiki](https://shiki.matsu.io/) syntax highlighter, etc.). - Share regexes across your Ruby and JavaScript code. -Compared to running the actual [Oniguruma](https://github.com/kkos/oniguruma) C library in JavaScript via WASM bindings (e.g. via [vscode-oniguruma](https://github.com/microsoft/vscode-oniguruma)), this library is **much lighter weight** (the WASM binary alone is > 460 KB) and its regexes typically **run much faster** since they run as native JavaScript. +Compared to running the actual [Oniguruma](https://github.com/kkos/oniguruma) C library in JavaScript via WASM bindings (e.g. via [vscode-oniguruma](https://github.com/microsoft/vscode-oniguruma)), this library is **much lighter weight** (the WASM binary alone is 460+ KB) and its regexes typically **run much faster** since they run as native JavaScript. ### [Try the demo REPL](https://slevithan.github.io/oniguruma-to-es/demo/) @@ -236,7 +236,7 @@ Higher limits have no effect on regexes that don't use recursion, so you should ### `target` -*Default: `'ES2024'`.* +One of `'ES2018'`, `'ES2024'` *(default)*, or `'ESNext'`. Sets the JavaScript language version for the generated pattern and flags. Later targets allow faster processing, simpler generated source, and support for additional features. @@ -955,7 +955,7 @@ Oniguruma-To-ES fully supports mixed case-sensitivity (and handles the Unicode e Oniguruma-To-ES focuses on being lightweight to make it better for use in browsers. This is partly achieved by not including heavyweight Unicode character data, which imposes a couple of minor/rare restrictions: -- Character class intersection and nested negated character classes are unsupported with target `ES2018`. Use target `ES2024` or later if you need support for these Oniguruma features. +- Character class intersection and nested negated character classes are unsupported with target `ES2018`. Use target `ES2024` or later if you need support for these features. - With targets before `ESNext`, a handful of Unicode properties that target a specific character case (ex: `\p{Lower}`) can't be used case-insensitively in patterns that contain other characters with a specific case that are used case-sensitively. - In other words, almost every usage is fine, including `A\p{Lower}`, `(?i:A\p{Lower})`, `(?i:A)\p{Lower}`, `(?i:A(?-i:\p{Lower}))`, and `\w(?i:\p{Lower})`, but not `A(?i:\p{Lower})`. - Using these properties case-insensitively is basically never done intentionally, so you're unlikely to encounter this error unless it's catching a mistake. diff --git a/package.json b/package.json index 7e9b9ba..c19bccd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "oniguruma-to-es", "version": "0.1.0", - "description": "Convert Oniguruma regexes to native JavaScript RegExp", + "description": "Convert Oniguruma patterns to native JavaScript regexes", "author": "Steven Levithan", "license": "MIT", "type": "module",