🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@codemirror/search

Package Overview
Dependencies
Maintainers
2
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codemirror/search - npm Package Compare versions

Comparing version

to
6.5.9

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 6.5.9 (2025-02-12)
### Bug fixes
When replacing a regexp match, don't expand multi-digit replacement markers to numbers beyond the captured group count in the query.
## 6.5.8 (2024-11-22)

@@ -2,0 +8,0 @@

16

dist/index.js

@@ -738,6 +738,14 @@ import { showPanel, EditorView, getPanel, Decoration, ViewPlugin, runScopeHandlers } from '@codemirror/view';

getReplacement(result) {
return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g, (m, i) => i == "$" ? "$"
: i == "&" ? result.match[0]
: i != "0" && +i < result.match.length ? result.match[i]
: m);
return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g, (m, i) => {
if (i == "&")
return result.match[0];
if (i == "$")
return "$";
for (let l = i.length; l > 0; l--) {
let n = +i.slice(0, l);
if (n > 0 && n < result.match.length)
return result.match[n] + i.slice(l);
}
return m;
});
}

@@ -744,0 +752,0 @@ matchAll(state, limit) {

{
"name": "@codemirror/search",
"version": "6.5.8",
"version": "6.5.9",
"description": "Search functionality for the CodeMirror code editor",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet