snake-case
Advanced tools
Comparing version 1.0.1 to 1.1.0
{ | ||
"name": "snake-case", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Snake case a string", | ||
"main": "snake-case.js", | ||
"files": [ | ||
"snake-case.js", | ||
"LICENSE" | ||
], | ||
"scripts": { | ||
@@ -30,7 +34,8 @@ "test": "istanbul cover _mocha -- -R spec" | ||
"istanbul": "^0.3.0", | ||
"mocha": "^1.18.2" | ||
"mocha": "^1.18.2", | ||
"pre-commit": "0.0.9" | ||
}, | ||
"dependencies": { | ||
"sentence-case": "^1.0.2" | ||
"sentence-case": "^1.1.1" | ||
} | ||
} |
@@ -6,6 +6,7 @@ # Snake Case | ||
[![Test coverage][coveralls-image]][coveralls-url] | ||
[![Gittip][gittip-image]][gittip-url] | ||
Snake case a string. | ||
Supports Unicode (non-ASCII characters) and non-string entities, such as objects with a `toString` property, numbers and booleans. Empty values (`null` and `undefined`) will result in an empty string. | ||
## Installation | ||
@@ -25,2 +26,4 @@ | ||
snakeCase('sentence case'); //=> "sentence_case" | ||
snakeCase('MY STRING', 'tr'); //=> "my_strıng" | ||
``` | ||
@@ -38,3 +41,1 @@ | ||
[coveralls-url]: https://coveralls.io/r/blakeembrey/snake-case?branch=master | ||
[gittip-image]: https://img.shields.io/gittip/blakeembrey.svg?style=flat | ||
[gittip-url]: https://www.gittip.com/blakeembrey |
@@ -1,2 +0,2 @@ | ||
var sentence = require('sentence-case'); | ||
var sentenceCase = require('sentence-case'); | ||
@@ -6,7 +6,8 @@ /** | ||
* | ||
* @param {String} string | ||
* @param {String} str | ||
* @param {String} [locale] | ||
* @return {String} | ||
*/ | ||
module.exports = function (string) { | ||
return sentence(string).replace(/ /g, '_'); | ||
module.exports = function (str, locale) { | ||
return sentenceCase(str, locale).replace(/ /g, '_'); | ||
}; |
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
39
3321
3
4
11
Updatedsentence-case@^1.1.1