Comparing version 2.0.0 to 2.1.0
@@ -8,2 +8,3 @@ type Options = { | ||
separateNumbers?: boolean; | ||
separateApostrophes?: boolean; | ||
tone?: boolean; | ||
@@ -10,0 +11,0 @@ } | string; |
@@ -17,4 +17,6 @@ 'use strict'; | ||
// Remove apostrophes contained within a word | ||
text = text.replace(/(\S)['\u2018\u2019\u201A\u201B\u2032\u2035\u0301](\S)/g, '$1$2'); // eslint-disable-line no-misleading-character-class | ||
text = text.replace( | ||
/(\S)['\u2018\u2019\u201A\u201B\u2032\u2035\u0301](\S)/g, // eslint-disable-line no-misleading-character-class | ||
options.separateApostrophes === true ? '$1 $2' : '$1$2' | ||
); | ||
@@ -21,0 +23,0 @@ // Break out any numbers contained within a word |
{ | ||
"name": "limax", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"main": "./lib/limax", | ||
@@ -38,8 +38,9 @@ "types": "index.d.ts", | ||
"Fabrice Labbe <fabrice.labbe@adfab.fr>", | ||
"Lukas Spieß <lukas.spiess@gmail.com>" | ||
"Lukas Spieß <lukas.spiess@gmail.com>", | ||
"David Dijan <david.djian@traceweb.fr>" | ||
], | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"hepburn": "^1.1.1", | ||
"pinyin": "^2.9.0", | ||
"hepburn": "^1.1.3", | ||
"pinyin": "^2.9.1", | ||
"speakingurl": "^14.0.1" | ||
@@ -49,5 +50,5 @@ }, | ||
"ava": "^2.4.0", | ||
"nyc": "^14.1.1", | ||
"semistandard": "^14.2.0" | ||
"nyc": "^15.1.0", | ||
"semistandard": "^14.2.2" | ||
} | ||
} |
@@ -58,2 +58,3 @@ # limax | ||
* `separateNumbers`: Boolean, separate numbers that are within a word, defaults to `false` | ||
* `separateApostrophes`: Boolean, separate apostrophes that are within a word, defaults to `false` | ||
* `maintainCase`: Boolean, maintain the original string's casing, defaults to `false` | ||
@@ -74,2 +75,6 @@ * `custom`: | ||
// separateApostrophes example | ||
const apostrophesInWord = slug('j\'aime'); // jaime | ||
const apostrophesSeparated = slug('j\'aime', { separateApostrophes: true }); // j-aime | ||
// maintainCase example | ||
@@ -104,3 +109,3 @@ const caseNotMaintained = slug('HelloWorld'); // helloworld | ||
Copyright 2013, 2014, 2015, 2016, 2017, 2018, 2019 Lovell Fuller and contributors. | ||
Copyright 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Lovell Fuller and contributors. | ||
@@ -107,0 +112,0 @@ Licensed under the Apache License, Version 2.0 (the "License"); |
20156
68
118
Updatedhepburn@^1.1.3
Updatedpinyin@^2.9.1