From 4e73a2ea6e03b4c65cd2f9d3ca7002be27da54ca Mon Sep 17 00:00:00 2001 From: Nathan Woltman Date: Sat, 2 Nov 2019 12:30:28 -0400 Subject: [PATCH] refactor: Use `Array.isArray()` instead of `instanceof Array` It's faster in newer versions of V8. --- lib/MySQLTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/MySQLTable.js b/lib/MySQLTable.js index 937e901..0e009f1 100644 --- a/lib/MySQLTable.js +++ b/lib/MySQLTable.js @@ -236,7 +236,7 @@ class MySQLTable { sqlString = ''; } - if (data instanceof Array) { + if (Array.isArray(data)) { data = data.length > 1 ? ' (' + this._db.escapeId(data[0]) + ') VALUES ' + this._db.escape(data[1]) : ' VALUES ' + this._db.escape(data[0]);