Merge pull request #44 from sjuxax/fix-replace-on-int

Skip replacement if there is no replace function on the value. ...
This commit is contained in:
pythongosssss
2023-08-20 09:09:56 +01:00
committed by GitHub
+1 -1
View File
@@ -182,7 +182,7 @@ app.registerExtension({
const callbacks = [
() => {
let prompt = widget.value;
if (replaceRegex) {
if (replaceRegex && typeof prompt.replace !== 'undefined') {
prompt = prompt.replace(replaceRegex, (match, p1, p2, index, text, groups) => {
if (!groups.replace || !groups.id) return match; // No match, bad regex?