From 1fb04f3d768394887020df0b7d9fce3d5814b142 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Mon, 25 Mar 2024 10:09:35 +0700 Subject: [PATCH] chore(ts): fix error TS7006: Parameter 'capturedValue' implicitly has an 'any' type Correction for cd71fb109d990df1a5fa32a8e3a659bd9ee49226 commit. Part of #35 --- examples/ts/express/mysql/app.ts | 2 +- src/templates/app.ts.ejs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ts/express/mysql/app.ts b/examples/ts/express/mysql/app.ts index ae98048..23f314c 100644 --- a/examples/ts/express/mysql/app.ts +++ b/examples/ts/express/mysql/app.ts @@ -17,7 +17,7 @@ const pool = mysql.createPool({ if (!values) { return query } - return query.replace(/\:(\w+)/g, function(matchedSubstring: string, capturedValue) { + return query.replace(/\:(\w+)/g, function(matchedSubstring: string, capturedValue: string) { if (values.hasOwnProperty(capturedValue)) { return this.escape(values[capturedValue]) } diff --git a/src/templates/app.ts.ejs b/src/templates/app.ts.ejs index 623ffe5..5479510 100644 --- a/src/templates/app.ts.ejs +++ b/src/templates/app.ts.ejs @@ -18,7 +18,7 @@ const pool = mysql.createPool({ return query } <%- // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_function_as_the_replacement -%> - return query.replace(/\:(\w+)/g, function(matchedSubstring: string, capturedValue) { + return query.replace(/\:(\w+)/g, function(matchedSubstring: string, capturedValue: string) { if (values.hasOwnProperty(capturedValue)) { return this.escape(values[capturedValue]) }