Skip to content

Commit

Permalink
🐛 return null if input is not string
Browse files Browse the repository at this point in the history
  • Loading branch information
noeldelgado committed May 19, 2020
1 parent f4b1032 commit 8c203de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { getHEX, getRGB, getHSL } from './utils';

const parseCSSColor = (str = '') => {
if (str === null) return null;
if (typeof str !== 'string') return null;

const hex = hexRe.exec(str);
if (hex) return getHEX(hex[0]);
Expand Down

0 comments on commit 8c203de

Please sign in to comment.