diff --git a/src/index.ts b/src/index.ts index e9c1b90..4e6a855 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,6 +8,9 @@ import startCase from 'lodash/startCase'; export const sanitize = (string: string) => { return ( string + // Storybook will occasionally pass a number which throws. + // This prevents that from crashing a build. + .toString() .toLowerCase() // eslint-disable-next-line no-useless-escape .replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, '-')