Skip to content

Commit

Permalink
chore(ts): fix error TS7006: Parameter 'capturedValue' implicitly has…
Browse files Browse the repository at this point in the history
… an 'any' type

Correction for cd71fb1 commit.

Part of #35
  • Loading branch information
php-coder committed Mar 25, 2024
1 parent 6995d81 commit 1fb04f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/ts/express/mysql/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
Expand Down
2 changes: 1 addition & 1 deletion src/templates/app.ts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
Expand Down

0 comments on commit 1fb04f3

Please sign in to comment.