Skip to content

Commit

Permalink
Version 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
radixxko committed Oct 26, 2019
1 parent 7c59cee commit c5f127a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/string.js
Expand Up @@ -94,7 +94,7 @@ module.exports = function( overload ) // if overload === undefined extend String

defineFunction( 'dasherize', function( needle )
{
return construct( this.trim().replace(/[_\s]+/g, '-').replace(/([A-Z])/g, '-$1').replace(/-+/g, '-').toLowerCase() );
return construct( this.trim().replace(/[_/\s]+/g, '-').replace(/([A-Z])/g, '-$1').replace(/-+/g, '-').toLowerCase() );
});

defineFunction( 'equalsIgnoreCase', function( str )
Expand Down Expand Up @@ -213,7 +213,7 @@ module.exports = function( overload ) // if overload === undefined extend String

defineFunction( 'slugify', function()
{
return construct( construct( construct( this )[prefix+'latinise']().replace(/[^\w\s-]/g, '').toLowerCase() )[prefix+'dasherize']().replace(/^\-+|\-+$/g, '' ));
return construct( construct( construct( this )[prefix+'latinise']().replace(/[^\w\s/-]/g, '').toLowerCase() )[prefix+'dasherize']().replace(/^\-+|\-+$/g, '' ));
});

/*defineFunction( 'splitLeft', function( separator, maxSplit, limit )
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "liqd-string",
"description": "String helper functions",
"version": "1.0.4",
"version": "1.0.5",
"author": "radixxko",
"license": "MIT",
"main": "lib/string.js",
Expand Down
1 change: 1 addition & 0 deletions test/tests/extended_string.js
Expand Up @@ -660,6 +660,7 @@ describe('- slugify', function()
assert.ok( ExStr('Global Thermonuclear Warfare').slugify().toString() === 'global-thermonuclear-warfare' );
assert.ok( ExStr('Fast JSON Parsing').slugify().toString() === 'fast-json-parsing' );
assert.ok( ExStr('Crème brûlée').slugify().toString() === 'creme-brulee' );
assert.ok( ExStr('pros/cons').slugify().toString() === 'pros-cons' );
});
});

Expand Down
1 change: 1 addition & 0 deletions test/tests/string.js
Expand Up @@ -660,6 +660,7 @@ describe('- slugify', function()
assert.ok( 'Global Thermonuclear Warfare'.slugify() === 'global-thermonuclear-warfare' );
assert.ok( 'Fast JSON Parsing'.slugify() === 'fast-json-parsing' );
assert.ok( 'Crème brûlée'.slugify() === 'creme-brulee' );
assert.ok( 'pros/cons'.slugify() === 'pros-cons' );
});
});

Expand Down

0 comments on commit c5f127a

Please sign in to comment.