Comparing version 1.7.0 to 2.0.0
@@ -18,6 +18,6 @@ 'use strict'; | ||
// Remove apostrophes contained within a word | ||
text = text.replace(/(\S)['\u2018\u2019\u201A\u201B\u2032\u2035\u0301](\S)/g, '$1$2'); | ||
text = text.replace(/(\S)['\u2018\u2019\u201A\u201B\u2032\u2035\u0301](\S)/g, '$1$2'); // eslint-disable-line no-misleading-character-class | ||
// Break out any numbers contained within a word | ||
if (options.separateNumbers !== false) { | ||
if (options.separateNumbers === true) { | ||
text = text.replace(/([^\d\s])([0-9]+)([^\d\s])/g, '$1 $2 $3'); | ||
@@ -41,3 +41,3 @@ } | ||
text = pinyin(text, { | ||
'style': tone ? pinyin.STYLE_TONE2 : pinyin.STYLE_NORMAL | ||
style: tone ? pinyin.STYLE_TONE2 : pinyin.STYLE_NORMAL | ||
}).join(' '); | ||
@@ -44,0 +44,0 @@ // Remove punctuation symbols |
{ | ||
"name": "limax", | ||
"version": "1.7.0", | ||
"version": "2.0.0", | ||
"main": "./lib/limax", | ||
"types": "index.d.ts", | ||
"description": "Node.js module to generate URL slugs. Another one? This one cares about i18n and transliterates non-Latin scripts to conform to the RFC3986 standard. Mostly API-compatible with similar modules.", | ||
@@ -11,3 +12,3 @@ "repository": { | ||
"engines": { | ||
"node": ">=6" | ||
"node": ">=8" | ||
}, | ||
@@ -42,11 +43,11 @@ "scripts": { | ||
"dependencies": { | ||
"hepburn": "^1.1.0", | ||
"pinyin": "^2.8.3", | ||
"hepburn": "^1.1.1", | ||
"pinyin": "^2.9.0", | ||
"speakingurl": "^14.0.1" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.25.0", | ||
"nyc": "^13.0.1", | ||
"semistandard": "^12.0.1" | ||
"ava": "^2.4.0", | ||
"nyc": "^14.1.1", | ||
"semistandard": "^14.2.0" | ||
} | ||
} |
@@ -57,3 +57,3 @@ # limax | ||
* `tone`: Boolean, add tone numbers to Pinyin transliteration of Chinese, defaults to `true` | ||
* `separateNumbers`: Boolean, separate numbers that are within a word, defaults to `true` | ||
* `separateNumbers`: Boolean, separate numbers that are within a word, defaults to `false` | ||
* `maintainCase`: Boolean, maintain the original string's casing, defaults to `false` | ||
@@ -71,8 +71,8 @@ * `custom`: | ||
// separateNumbers example | ||
const numbersInWord = slug('hello2world', {separateNumbers: false}); // hello2world | ||
const numbersSeparated = slug('hello2world'); // hello-2-world | ||
const numbersInWord = slug('hello2world'); // hello2world | ||
const numbersSeparated = slug('hello2world', { separateNumbers: true }); // hello-2-world | ||
// maintainCase example | ||
const caseNotMaintained = slug('Hello2World'); // hello-2-world | ||
const caseMaintained = slug('Hello2World', { maintainCase: true }); // Hello-2-World | ||
const caseNotMaintained = slug('HelloWorld'); // helloworld | ||
const caseMaintained = slug('HelloWorld', { maintainCase: true }); // HelloWorld | ||
@@ -104,3 +104,3 @@ // custom example | ||
Copyright 2013, 2014, 2015, 2016, 2017, 2018 Lovell Fuller and contributors. | ||
Copyright 2013, 2014, 2015, 2016, 2017, 2018, 2019 Lovell Fuller and contributors. | ||
@@ -107,0 +107,0 @@ Licensed under the Apache License, Version 2.0 (the "License"); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19789
5
65
Updatedhepburn@^1.1.1
Updatedpinyin@^2.9.0