From 08d9c740f1e944c3ed8bfa43b4dd6f74eda68fd9 Mon Sep 17 00:00:00 2001 From: Richie Bendall Date: Tue, 31 Mar 2020 22:25:33 +1300 Subject: [PATCH] Properly check if `level` is an integer --- source/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/index.js b/source/index.js index 53fcc16..7d05388 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'); }