Skip to content

Commit fe6aa3a

Browse files
committed
refactor: remove redundant parenthesis around regex
1 parent c4996a2 commit fe6aa3a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/base/prepared-statement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class PreparedStatement extends EventEmitter {
9191
*/
9292

9393
input (name, type) {
94-
if ((/(--| |\/\*|\*\/|')/).test(name)) {
94+
if (/(--| |\/\*|\*\/|')/.test(name)) {
9595
throw new PreparedStatementError(`SQL injection warning for param '${name}'`, 'EINJECT')
9696
}
9797

lib/base/request.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class Request extends EventEmitter {
107107
*/
108108

109109
input (name, type, value) {
110-
if ((/(--| |\/\*|\*\/|')/).test(name)) {
110+
if (/(--| |\/\*|\*\/|')/.test(name)) {
111111
throw new RequestError(`SQL injection warning for param '${name}'`, 'EINJECT')
112112
}
113113

@@ -170,7 +170,7 @@ class Request extends EventEmitter {
170170
output (name, type, value) {
171171
if (!type) { type = TYPES.NVarChar }
172172

173-
if ((/(--| |\/\*|\*\/|')/).test(name)) {
173+
if (/(--| |\/\*|\*\/|')/.test(name)) {
174174
throw new RequestError(`SQL injection warning for param '${name}'`, 'EINJECT')
175175
}
176176

0 commit comments

Comments
 (0)