From 7f21f209da984ef156195d814a8cba20e8e28d10 Mon Sep 17 00:00:00 2001 From: Richie Bendall Date: Thu, 2 Apr 2020 20:49:20 +1300 Subject: [PATCH] Properly check if `level` is an integer (#393) --- source/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/index.js b/source/index.js index 4ab1271..28d529a 100644 --- a/source/index.js +++ b/source/index.js @@ -17,7 +17,7 @@ const levelMapping = [ const styles = Object.create(null); const applyOptions = (object, options = {}) => { - if (options.level > 3 || options.level < 0) { + if (!Number.isInteger(options.level) || options.level > 3 || options.level < 0) { throw new Error('The `level` option should be an integer from 0 to 3'); }