diff --git a/lib/utils/objects.js b/lib/utils/objects.js index cbe1388..698a671 100644 --- a/lib/utils/objects.js +++ b/lib/utils/objects.js @@ -3,7 +3,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const random = require('../random') -const utils = require('../utils') const logger = require('../logging') var o = null // eslint-disable-line no-unused-vars @@ -49,7 +48,7 @@ class Objects { pop (objectName) { let self = this - utils.common.getKeysFromHash(this.container).forEach(function (category) { + Object.keys(this.container).forEach(function (category) { self.container[category].forEach(function (obj) { if (obj.name === objectName) { self.container[category].splice(self.container[category].indexOf(obj), 1) @@ -88,10 +87,10 @@ class Objects { valid () { let items = [] let self = this - utils.common.getKeysFromHash(self.container).forEach(function (category) { + Object.keys(self.container).forEach(function (category) { self.check(category) }) - utils.common.getKeysFromHash(self.container).forEach(function (category) { + Object.keys(self.container).forEach(function (category) { for (let i = 0; i < self.container[category].length; i++) { items.push(self.container[category][i].name) } diff --git a/lib/utils/script.js b/lib/utils/script.js index e711b2b..b5f5983 100644 --- a/lib/utils/script.js +++ b/lib/utils/script.js @@ -56,7 +56,7 @@ class script extends utils { } static methodCall (objectName, methodHash) { - if (!utils.common.getKeysFromHash(methodHash).length || !objectName) { + if (!Object.keys(methodHash).length || !objectName) { return '' } let methodName = random.key(methodHash) @@ -115,7 +115,7 @@ class script extends utils { } static setAttribute (objectName, attributeHash) { - if (!utils.common.getKeysFromHash(attributeHash).length || !objectName) { + if (!Object.keys(attributeHash).length || !objectName) { return '' } let attributeName = random.key(attributeHash)