From d17b53d0499c0796c57538472d15a053e06348f1 Mon Sep 17 00:00:00 2001 From: FullGreaM Date: Sun, 19 Jan 2025 05:18:50 +0300 Subject: [PATCH] Cosmetic and functionally fixes for module root API --- modules/index.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/index.js b/modules/index.js index c2daf39..df8a729 100644 --- a/modules/index.js +++ b/modules/index.js @@ -1,8 +1,8 @@ // Func -class OperatorsStorage extends Array { - constructor (...p) { - super(...p); +class OperatorStorage extends Array { + constructor () { + super(); this._indexObject = {}; this._indexObjectIndexOf = {}; } @@ -15,7 +15,7 @@ class OperatorsStorage extends Array { } } else - throw new TypeError("Into OperatorsStorage you can add only Operator's instances"); + throw new TypeError("Into OperatorStorage you can add only Operator's instances"); } includes (item) { @@ -23,7 +23,7 @@ class OperatorsStorage extends Array { return this._indexObject[item.operator] !== undefined; } else - throw new TypeError("Into OperatorsStorage storage only Operator type"); + throw new TypeError("Into OperatorStorage storage only Operator type"); } } @@ -41,9 +41,8 @@ class Operator { module.exports = class NetHelperModule { constructor () { - this.operators = new OperatorsStorage(); + this.operators = new OperatorStorage(); - this.statics = new Object(); - this.statics.Operator = Operator; + this.statics = { Operator }; } }