Skip to content

Commit ff681aa

Browse files
committed
style(js,ts): add a comment with a link to String.replace() API
1 parent f647d69 commit ff681aa

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/templates/app.js.ejs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const pool = mysql.createPool({
1616
if (!values) {
1717
return query
1818
}
19+
<%- // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_function_as_the_replacement -%>
1920
return query.replace(/\:(\w+)/g, function(txt, key) {
2021
if (values.hasOwnProperty(key)) {
2122
return this.escape(values[key])

src/templates/app.ts.ejs

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const pool = mysql.createPool({
1717
if (!values) {
1818
return query
1919
}
20+
<%- // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_function_as_the_replacement -%>
2021
return query.replace(/\:(\w+)/g, function(txt, key) {
2122
if (values.hasOwnProperty(key)) {
2223
return this.escape(values[key])

0 commit comments

Comments
 (0)