Update ESLint-related packages
R=jacktfranklin@chromium.org
No-Presubmit: True
Bug: none
Change-Id: I52dc24b12e350787085c5e3d131cface7ea87142
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3060705
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
diff --git a/node_modules/eslint-module-utils/hash.js b/node_modules/eslint-module-utils/hash.js
index d69dd4d..fcf00de 100644
--- a/node_modules/eslint-module-utils/hash.js
+++ b/node_modules/eslint-module-utils/hash.js
@@ -2,58 +2,58 @@
* utilities for hashing config objects.
* basically iteratively updates hash with a JSON-like format
*/
-'use strict'
-exports.__esModule = true
+'use strict';
+exports.__esModule = true;
-const createHash = require('crypto').createHash
+const createHash = require('crypto').createHash;
-const stringify = JSON.stringify
+const stringify = JSON.stringify;
function hashify(value, hash) {
- if (!hash) hash = createHash('sha256')
+ if (!hash) hash = createHash('sha256');
- if (value instanceof Array) {
- hashArray(value, hash)
+ if (Array.isArray(value)) {
+ hashArray(value, hash);
} else if (value instanceof Object) {
- hashObject(value, hash)
+ hashObject(value, hash);
} else {
- hash.update(stringify(value) || 'undefined')
+ hash.update(stringify(value) || 'undefined');
}
- return hash
+ return hash;
}
-exports.default = hashify
+exports.default = hashify;
function hashArray(array, hash) {
- if (!hash) hash = createHash('sha256')
+ if (!hash) hash = createHash('sha256');
- hash.update('[')
+ hash.update('[');
for (let i = 0; i < array.length; i++) {
- hashify(array[i], hash)
- hash.update(',')
+ hashify(array[i], hash);
+ hash.update(',');
}
- hash.update(']')
+ hash.update(']');
- return hash
+ return hash;
}
-hashify.array = hashArray
-exports.hashArray = hashArray
+hashify.array = hashArray;
+exports.hashArray = hashArray;
function hashObject(object, hash) {
- if (!hash) hash = createHash('sha256')
+ if (!hash) hash = createHash('sha256');
- hash.update('{')
+ hash.update('{');
Object.keys(object).sort().forEach(key => {
- hash.update(stringify(key))
- hash.update(':')
- hashify(object[key], hash)
- hash.update(',')
- })
- hash.update('}')
+ hash.update(stringify(key));
+ hash.update(':');
+ hashify(object[key], hash);
+ hash.update(',');
+ });
+ hash.update('}');
- return hash
+ return hash;
}
-hashify.object = hashObject
-exports.hashObject = hashObject
+hashify.object = hashObject;
+exports.hashObject = hashObject;