From cefea81993f6dc8cfee80d0b860a237b6d39a3e2 Mon Sep 17 00:00:00 2001 From: Ajeandon <37957314+Ajeandon@users.noreply.github.com> Date: Tue, 5 Mar 2024 15:46:14 -0500 Subject: [PATCH] Remove unnecessary instance check in the constructor Refactored the WooCommerceRestApi class constructor to remove the unnecessary instance check. In modern JavaScript classes, the new keyword is required to create an instance of a class. --- index.mjs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/index.mjs b/index.mjs index e42f229..05416ca 100644 --- a/index.mjs +++ b/index.mjs @@ -17,10 +17,6 @@ export default class WooCommerceRestApi { * @param {Object} opt */ constructor(opt) { - if (!(this instanceof WooCommerceRestApi)) { - return new WooCommerceRestApi(opt); - } - opt = opt || {}; if (!opt.url) {