From 298ee4e79ff429d95d6e5d86b2144605bfa6a4f9 Mon Sep 17 00:00:00 2001 From: bdistin Date: Tue, 25 Apr 2017 16:29:30 -0500 Subject: [PATCH] Throw an error if you try to initiate a new SnowflakeUtil class instance (#1413) --- src/util/Snowflake.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/Snowflake.js b/src/util/Snowflake.js index a137a4699..69ecd6a6f 100644 --- a/src/util/Snowflake.js +++ b/src/util/Snowflake.js @@ -8,6 +8,10 @@ let INCREMENT = 0; * A container for useful snowflake-related methods */ class SnowflakeUtil { + constructor() { + throw new Error(`The ${this.constructor.name} class may not be instantiated.`); + } + /** * A Twitter snowflake, except the epoch is 2015-01-01T00:00:00.000Z * ```