Skip to content

Commit

Permalink
Fixes support for CommonJS require.
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldietrich committed Sep 5, 2019
1 parent 92436f4 commit 88205ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @param separator (optional) a separator, default: hyphen '-'
* @returns a new string, consisting of letters [a-zA-Z], digits [0-9] and the `separator`
*/
export default function slugify(input: string, separator: string = '-'): string {
export = function slugify(input: string, separator: string = '-'): string {
if (!input) {
return input; // also returns unaltered null, undefined, 0 and false
}
Expand All @@ -19,7 +19,7 @@ export default function slugify(input: string, separator: string = '-'): string
} else {
return res.substring(from, res.length - back);
}
}
};

const ignored = /[^a-z0-9]+/gi;

Expand Down

0 comments on commit 88205ed

Please sign in to comment.