refactor(Util): make class extend null (#6000)

This commit is contained in:
Antonio Román
2021-07-03 14:25:35 +02:00
committed by GitHub
parent e7ad2fe207
commit 2446ff5251
5 changed files with 12 additions and 24 deletions

View File

@@ -10,11 +10,7 @@ const isObject = d => typeof d === 'object' && d !== null;
/**
* Contains various general-purpose utility methods.
*/
class Util {
constructor() {
throw new Error(`The ${this.constructor.name} class may not be instantiated.`);
}
class Util extends null {
/**
* Flatten an object. Any properties that are collections will get converted to an array of keys.
* @param {Object} obj The object to flatten.