From c45db4e0978999cece915e7f1a223aa9eb445ae0 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 21 Sep 2023 13:55:17 -0700 Subject: [PATCH] [Performance] use inline `typeof` --- lib/test.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/test.js b/lib/test.js index 926da137..90bbedf6 100644 --- a/lib/test.js +++ b/lib/test.js @@ -30,12 +30,11 @@ function getTestArgs(name_, opts_, cb_) { for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; - var t = typeof arg; - if (t === 'string') { + if (typeof arg === 'string') { name = arg; - } else if (t === 'object') { + } else if (typeof arg === 'object') { opts = arg || opts; - } else if (t === 'function') { + } else if (typeof arg === 'function') { cb = arg; } }