Skip to content

Commit 2189378

Browse files
authoredApr 24, 2020
Merge pull request #265 from timgates42/bugfix_typo_delimiter
docs: Fix simple typo, delimeter -> delimiter
2 parents 0771418 + fc281b2 commit 2189378

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎doc/string.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -435,10 +435,10 @@ startsWith('lorem ipsum', 'ipsum'); // false
435435

436436

437437

438-
## slugify(str[, delimeter]):String
438+
## slugify(str[, delimiter]):String
439439

440440
Convert to lower case, remove accents, remove non-word chars and replace spaces
441-
with the delimeter. The default delimeter is a hyphen.
441+
with the delimiter. The default delimiter is a hyphen.
442442

443443
Note that this does not split camelCase text.
444444

‎src/string/slugify.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
define(['../lang/toString', './replaceAccents', './removeNonWord', './trim'], function(toString, replaceAccents, removeNonWord, trim){
22
/**
33
* Convert to lower case, remove accents, remove non-word chars and
4-
* replace spaces with the specified delimeter.
4+
* replace spaces with the specified delimiter.
55
* Does not split camelCase text.
66
*/
7-
function slugify(str, delimeter){
7+
function slugify(str, delimiter){
88
str = toString(str);
99

10-
if (delimeter == null) {
11-
delimeter = "-";
10+
if (delimiter == null) {
11+
delimiter = "-";
1212
}
1313
str = replaceAccents(str);
1414
str = removeNonWord(str);
1515
str = trim(str) //should come after removeNonWord
16-
.replace(/ +/g, delimeter) //replace spaces with delimeter
16+
.replace(/ +/g, delimiter) //replace spaces with delimiter
1717
.toLowerCase();
1818
return str;
1919
}

0 commit comments

Comments
 (0)
Please sign in to comment.