Skip to content

Commit

Permalink
Properly check if level is an integer (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richienb committed Apr 2, 2020
1 parent 63469d3 commit 7f21f20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/index.js
Expand Up @@ -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');
}

Expand Down

0 comments on commit 7f21f20

Please sign in to comment.