slug.js: line 5, col 19, Expected '{' and instead saw 'return'.
slug.js: line 8, col 60, Missing semicolon.
slug.js: line 15, col 9, Expected '{' and instead saw 'opts'.
slug.js: line 24, col 9, Expected '{' and instead saw 'opts'.
slug.js: line 27, col 18, 'key' is already defined.
slug.js: line 29, col 13, Expected '{' and instead saw 'continue'.
slug.js: line 33, col 13, Expected '{' and instead saw 'lengths'.
slug.js: line 37, col 22, 'i' is already defined.
slug.js: line 37, col 29, 'l' is already defined.
slug.js: line 44, col 20, Expected '{' and instead saw 'return'.
slug.js: line 45, col 10, Don't make functions within a loop.
slug.js: line 61, col 26, Expected '{' and instead saw 'char'.
slug.js: line 68, col 7, Expected '{' and instead saw 'result'.
slug.js: line 70, col 2, Unnecessary semicolon.
slug.js: line 193, col 13, Expected '{' and instead saw 'continue'.
slug.js: line 197, col 40, Missing semicolon.
slug.js: line 203, col 18, 'key' is already defined.
slug.js: line 205, col 13, Expected '{' and instead saw 'continue'.
Note that,
I have used [].forEach() where appropriate, because it is as well supported in browsers as [].some() is, so this is a non breaking change.
I haven't used Object.keys() because it is not as well supported as [].some, so some browsers would have suffered from the change.
I have not changed the algorithm at all, as this in not part of this work.
I'm trying to sum up all PR:s from this project to a fork here https://github.com/larvit/larvitslugify until this project comes alive again. Could you pretty please add this PR to that fork?
Added JSHint to project and to build.
Fixed all 18 errors below,
Note that,
[].forEach()
where appropriate, because it is as well supported in browsers as[].some()
is, so this is a non breaking change.Object.keys()
because it is not as well supported as[].some
, so some browsers would have suffered from the change.