Fix: replace deprecated String.prototype.substr with slice (#23915)

Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
Co-authored-by: Yongtao Huang <99629139+hyongtao-db@users.noreply.github.com>
This commit is contained in:
Yongtao Huang 2025-08-14 13:47:23 +08:00 • committed by GitHub
commit 2476511368
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View file

@ -259,7 +259,7 @@ function getFullMatchOffset(
): number {
let triggerOffset = offset
for (let i = triggerOffset; i <= entryText.length; i++) {
if (documentText.substr(-i) === entryText.substr(0, i))
if (documentText.slice(-i) === entryText.slice(0, i))
triggerOffset = i
}
return triggerOffset