Skip to content

Commit 6995d81

Browse files
committed
chore(ts): fix error TS7006: Parameter 'matchedSubstring' implicitly has an 'any' type.
Correction for cd71fb1 commit. Part of #35
1 parent aca4d44 commit 6995d81

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/ts/express/mysql/app.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const pool = mysql.createPool({
1717
if (!values) {
1818
return query
1919
}
20-
return query.replace(/\:(\w+)/g, function(matchedSubstring, capturedValue) {
20+
return query.replace(/\:(\w+)/g, function(matchedSubstring: string, capturedValue) {
2121
if (values.hasOwnProperty(capturedValue)) {
2222
return this.escape(values[capturedValue])
2323
}

src/templates/app.ts.ejs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const pool = mysql.createPool({
1818
return query
1919
}
2020
<%- // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_function_as_the_replacement -%>
21-
return query.replace(/\:(\w+)/g, function(matchedSubstring, capturedValue) {
21+
return query.replace(/\:(\w+)/g, function(matchedSubstring: string, capturedValue) {
2222
if (values.hasOwnProperty(capturedValue)) {
2323
return this.escape(values[capturedValue])
2424
}

0 commit comments

Comments
 (0)