lodash.snakecase
Advanced tools
Comparing version 4.0.0 to 4.0.1
25
index.js
/** | ||
* lodash 4.0.0 (Custom Build) <https://lodash.com/> | ||
* lodash 4.0.1 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
* Copyright jQuery Foundation and other contributors <https://jquery.org/> | ||
* Released under MIT license <https://lodash.com/license> | ||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Available under MIT license <https://lodash.com/license> | ||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
*/ | ||
@@ -12,2 +12,8 @@ var deburr = require('lodash.deburr'), | ||
/** Used to compose unicode capture groups. */ | ||
var rsApos = "['\u2019]"; | ||
/** Used to match apostrophes. */ | ||
var reApos = RegExp(rsApos, 'g'); | ||
/** | ||
@@ -21,3 +27,4 @@ * A specialized version of `_.reduce` for arrays without support for | ||
* @param {*} [accumulator] The initial value. | ||
* @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. | ||
* @param {boolean} [initAccum] Specify using the first element of `array` as | ||
* the initial value. | ||
* @returns {*} Returns the accumulated value. | ||
@@ -47,3 +54,3 @@ */ | ||
return function(string) { | ||
return arrayReduce(words(deburr(string)), callback, ''); | ||
return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); | ||
}; | ||
@@ -53,6 +60,8 @@ } | ||
/** | ||
* Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case). | ||
* Converts `string` to | ||
* [snake case](https://en.wikipedia.org/wiki/Snake_case). | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 3.0.0 | ||
* @category String | ||
@@ -69,3 +78,3 @@ * @param {string} [string=''] The string to convert. | ||
* | ||
* _.snakeCase('--foo-bar'); | ||
* _.snakeCase('--FOO-BAR--'); | ||
* // => 'foo_bar' | ||
@@ -72,0 +81,0 @@ */ |
{ | ||
"name": "lodash.snakecase", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "The lodash method `_.snakeCase` exported as a module.", | ||
@@ -12,3 +12,3 @@ "homepage": "https://lodash.com/", | ||
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)", | ||
"Blaine Bublitz <blaine@iceddev.com> (https://github.com/phated)", | ||
"Blaine Bublitz <blaine.bublitz@gmail.com> (https://github.com/phated)", | ||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" | ||
@@ -15,0 +15,0 @@ ], |
@@ -1,2 +0,2 @@ | ||
# lodash.snakecase v4.0.0 | ||
# lodash.snakecase v4.0.1 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.snakeCase` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [documentation](https://lodash.com/docs#snakeCase) or [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash.snakecase) for more details. | ||
See the [documentation](https://lodash.com/docs#snakeCase) or [package source](https://github.com/lodash/lodash/blob/4.0.1-npm-packages/lodash.snakecase) for more details. |
Sorry, the diff of this file is not supported yet
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
Mixed license
License(Experimental) Package contains multiple licenses.
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
5538
74
1