Comparing version 0.3.0 to 0.4.0
@@ -0,1 +1,7 @@ | ||
## 0.4.0 (14th April, 2017) | ||
* fixed various default inflection bugs | ||
* updated to latest node | ||
* updated dependencies | ||
## 0.3.0 (20th September, 2012) | ||
@@ -2,0 +8,0 @@ |
@@ -1,3 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.12.5 | ||
module.exports = require("./inflect"); |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.12.5 | ||
var inflect; | ||
@@ -9,3 +9,3 @@ | ||
inflect.plural(/s$/i, 's'); | ||
inflect.plural(/(ax|test)is$/i, '$1es'); | ||
inflect.plural(/^(ax|test)is$/i, '$1es'); | ||
inflect.plural(/(octop|vir)us$/i, '$1i'); | ||
@@ -24,4 +24,4 @@ inflect.plural(/(octop|vir)i$/i, '$1i'); | ||
inflect.plural(/(matr|vert|ind)(?:ix|ex)$/i, '$1ices'); | ||
inflect.plural(/([m|l])ouse$/i, '$1ice'); | ||
inflect.plural(/([m|l])ice$/i, '$1ice'); | ||
inflect.plural(/^([m|l])ouse$/i, '$1ice'); | ||
inflect.plural(/^([m|l])ice$/i, '$1ice'); | ||
inflect.plural(/^(ox)$/i, '$1en'); | ||
@@ -31,6 +31,7 @@ inflect.plural(/^(oxen)$/i, '$1'); | ||
inflect.singular(/s$/i, ''); | ||
inflect.singular(/(ss)$/i, '$1'); | ||
inflect.singular(/(n)ews$/i, '$1ews'); | ||
inflect.singular(/([ti])a$/i, '$1um'); | ||
inflect.singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, '$1$2sis'); | ||
inflect.singular(/(^analy)ses$/i, '$1sis'); | ||
inflect.singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i, '$1sis'); | ||
inflect.singular(/(^analy)(sis|ses)$/i, '$1sis'); | ||
inflect.singular(/([^f])ves$/i, '$1fe'); | ||
@@ -44,9 +45,10 @@ inflect.singular(/(hive)s$/i, '$1'); | ||
inflect.singular(/(x|ch|ss|sh)es$/i, '$1'); | ||
inflect.singular(/([m|l])ice$/i, '$1ouse'); | ||
inflect.singular(/(bus)es$/i, '$1'); | ||
inflect.singular(/^([m|l])ice$/i, '$1ouse'); | ||
inflect.singular(/(bus)(es)?$/i, '$1'); | ||
inflect.singular(/(o)es$/i, '$1'); | ||
inflect.singular(/(shoe)s$/i, '$1'); | ||
inflect.singular(/(cris|ax|test)es$/i, '$1is'); | ||
inflect.singular(/(octop|vir)i$/i, '$1us'); | ||
inflect.singular(/(alias|status)es$/i, '$1'); | ||
inflect.singular(/(cris|test)(is|es)$/i, '$1is'); | ||
inflect.singular(/^(a)x[ie]s$/i, '$1xis'); | ||
inflect.singular(/(octop|vir)(us|i)$/i, '$1us'); | ||
inflect.singular(/(alias|status)(es)?$/i, '$1'); | ||
inflect.singular(/^(ox)en/i, '$1'); | ||
@@ -74,5 +76,4 @@ inflect.singular(/(vert|ind)ices$/i, '$1ex'); | ||
inflect.irregular('sex', 'sexes'); | ||
inflect.irregular('cow', 'kine'); | ||
inflect.irregular('zombie', 'zombies'); | ||
inflect.uncountable('advice', 'energy', 'excretion', 'digestion', 'cooperation', 'health', 'justice', 'jeans'); | ||
inflect.uncountable('advice', 'energy', 'excretion', 'digestion', 'cooperation', 'health', 'justice', 'jeans', 'police'); | ||
inflect.uncountable('labour', 'machinery', 'equipment', 'information', 'pollution', 'sewage', 'paper', 'money'); | ||
@@ -79,0 +80,0 @@ inflect.uncountable('species', 'series', 'rain', 'rice', 'fish', 'sheep', 'moose', 'deer', 'bison', 'proceedings'); |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.12.5 | ||
var Inflections, inflections, methods, number_extensions, string_extensions; | ||
@@ -3,0 +3,0 @@ |
@@ -1,7 +0,6 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.12.5 | ||
var Inflections, | ||
__slice = [].slice; | ||
slice = [].slice; | ||
Inflections = (function() { | ||
Inflections.instance = function() { | ||
@@ -64,3 +63,3 @@ return this.__instance__ || (this.__instance__ = new this); | ||
var words; | ||
words = 1 <= arguments.length ? __slice.call(arguments, 0) : []; | ||
words = 1 <= arguments.length ? slice.call(arguments, 0) : []; | ||
return this.uncountables = this.uncountables.concat(words); | ||
@@ -67,0 +66,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.12.5 | ||
var camelize, capitalize, dasherize, decapitalize, humanize, inflections, ordinalize, parameterize, pluralize, singularize, titleize, underscore; | ||
@@ -50,3 +50,3 @@ | ||
pluralize = function(word) { | ||
var plural, replacement, result, rule, _i, _len, _ref; | ||
var i, len, plural, ref, replacement, result, rule; | ||
result = word.toString(); | ||
@@ -56,5 +56,5 @@ if (word.length === 0 || inflections().uncountables.indexOf(result.toLowerCase()) !== -1) { | ||
} else { | ||
_ref = inflections().plurals; | ||
for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
plural = _ref[_i]; | ||
ref = inflections().plurals; | ||
for (i = 0, len = ref.length; i < len; i++) { | ||
plural = ref[i]; | ||
rule = plural[0]; | ||
@@ -72,8 +72,8 @@ replacement = plural[1]; | ||
singularize = function(word) { | ||
var inflection, replacement, result, rule, singular, uncountable, _i, _j, _len, _len1, _ref, _ref1; | ||
var i, inflection, j, len, len1, ref, ref1, replacement, result, rule, singular, uncountable; | ||
result = word.toString(); | ||
uncountable = false; | ||
_ref = inflections().uncountables; | ||
for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
inflection = _ref[_i]; | ||
ref = inflections().uncountables; | ||
for (i = 0, len = ref.length; i < len; i++) { | ||
inflection = ref[i]; | ||
if (result.search(new RegExp("\\b" + inflection + "$", 'i')) !== -1) { | ||
@@ -87,5 +87,5 @@ uncountable = true; | ||
} else { | ||
_ref1 = inflections().singulars; | ||
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { | ||
singular = _ref1[_j]; | ||
ref1 = inflections().singulars; | ||
for (j = 0, len1 = ref1.length; j < len1; j++) { | ||
singular = ref1[j]; | ||
rule = singular[0]; | ||
@@ -103,7 +103,7 @@ replacement = singular[1]; | ||
humanize = function(lower_case_and_underscored_word) { | ||
var human, replacement, result, rule, _i, _len, _ref; | ||
var human, i, len, ref, replacement, result, rule; | ||
result = lower_case_and_underscored_word.toString(); | ||
_ref = inflections().humans; | ||
for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
human = _ref[_i]; | ||
ref = inflections().humans; | ||
for (i = 0, len = ref.length; i < len; i++) { | ||
human = ref[i]; | ||
rule = human[0]; | ||
@@ -123,13 +123,13 @@ replacement = human[1]; | ||
if ([11, 12, 13].indexOf(number_int % 100) !== -1) { | ||
return "" + number + "th"; | ||
return number + "th"; | ||
} else { | ||
switch (number_int % 10) { | ||
case 1: | ||
return "" + number + "st"; | ||
return number + "st"; | ||
case 2: | ||
return "" + number + "nd"; | ||
return number + "nd"; | ||
case 3: | ||
return "" + number + "rd"; | ||
return number + "rd"; | ||
default: | ||
return "" + number + "th"; | ||
return number + "th"; | ||
} | ||
@@ -147,3 +147,3 @@ } | ||
if (sep != null) { | ||
parameterized_string = parameterized_string.replace(new RegExp("" + sep + "{2,}", 'g'), sep); | ||
parameterized_string = parameterized_string.replace(new RegExp(sep + "{2,}", 'g'), sep); | ||
parameterized_string = parameterized_string.replace(new RegExp("^" + sep + "|" + sep + "$", 'gi'), ''); | ||
@@ -150,0 +150,0 @@ } |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.12.5 | ||
var enableNumberExtensions, inflect; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.12.5 | ||
var enableStringExtensions, inflect; | ||
@@ -3,0 +3,0 @@ |
{ | ||
"name": "inflect", | ||
"description": "A port of the Rails / ActiveSupport inflector to JavaScript.", | ||
"keywords": ["inflect", "activerecord", "rails", "activesupport", "string"], | ||
"version": "0.3.0", | ||
"keywords": [ | ||
"inflect", | ||
"activerecord", | ||
"rails", | ||
"activesupport", | ||
"string" | ||
], | ||
"version": "0.4.0", | ||
"license": "MIT", | ||
"author": "Stefan Huber <MSNexploder@gmail.com>", | ||
@@ -23,14 +30,15 @@ "homepage": "http://msnexploder.github.com/inflect/", | ||
"directories": { | ||
"doc":"./doc", | ||
"lib":"./lib" | ||
"doc": "./doc", | ||
"lib": "./lib" | ||
}, | ||
"engines": { | ||
"node": ">=0.4" | ||
"node": ">=6.9.0" | ||
}, | ||
"devDependencies": { | ||
"coffee-script": "~1.3.3", | ||
"docco": "~0.4.0", | ||
"vows": "~0.6.4", | ||
"browserify": "~1.16.1", | ||
"uglify-js": "~1.3.3" | ||
"browserify": "~14.3.0", | ||
"coffee-script": "~1.12.5", | ||
"coffeeify": "^2.1.0", | ||
"docco": "~0.7.0", | ||
"uglify-js": "~2.8.22", | ||
"vows": "~0.8.1" | ||
}, | ||
@@ -41,8 +49,5 @@ "repository": { | ||
}, | ||
"bugs": { "url": "https://github.com/MSNexploder/inflect/issues" }, | ||
"licenses": [ | ||
{ "type": "MIT", | ||
"url": "https://github.com/MSNexploder/inflect/raw/master/LICENSE" | ||
} | ||
] | ||
} | ||
"bugs": { | ||
"url": "https://github.com/MSNexploder/inflect/issues" | ||
} | ||
} |
@@ -45,13 +45,1 @@ # Inflect [![Build Status](https://secure.travis-ci.org/MSNexploder/inflect.png)](http://travis-ci.org/MSNexploder/inflect) | ||
* Send me a pull request. Bonus points for topic branches. | ||
## License | ||
(The MIT License) | ||
Copyright © 2011 Stefan Huber | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
2279
300190
6
45
3