prostore.pluralize
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "prostore.pluralize", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Simple Russian Pluralizer", | ||
"main": "src/index.js", | ||
"devDependencies": { | ||
"mocha": "*" | ||
"mocha": "*", | ||
"pre-commit": "*", | ||
"eslint": "*" | ||
}, | ||
"scripts": { | ||
"pretest": "eslint .", | ||
"test": "mocha -R spec" | ||
}, | ||
"pre-commit": [ | ||
"test" | ||
], | ||
"repository": { | ||
@@ -13,0 +19,0 @@ "type": "git", |
@@ -1,4 +0,4 @@ | ||
"use strict"; | ||
'use strict'; | ||
module.exports = exports = function(num, s1, s2, s5) { | ||
module.exports = exports = function (num, s1, s2, s5) { | ||
function p(a) { | ||
@@ -9,2 +9,3 @@ if (a % 10 == 1 && a % 100 != 11) return 0; | ||
} | ||
switch (p(num)) { | ||
@@ -20,6 +21,6 @@ case 0: | ||
exports.formatter = function(s1, s2, s5) { | ||
return function(num) { | ||
exports.formatter = function (s1, s2, s5) { | ||
return function (num) { | ||
return exports(num, s1, s2, s5); | ||
} | ||
}; | ||
}; |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -6,17 +6,17 @@ var assert = require('assert') | ||
describe('Pluralize', function() { | ||
describe('Pluralize', function () { | ||
it('should emit correct "one"', function() { | ||
it('should emit correct "one"', function () { | ||
assert(pluralize(1, '%s корова', '%s коровы', '%s коров'), '1 корова'); | ||
}); | ||
it('should emit correct "few"', function() { | ||
it('should emit correct "few"', function () { | ||
assert(pluralize(3, '%s корова', '%s коровы', '%s коров'), '3 коровы'); | ||
}); | ||
it('should emit correct "many"', function() { | ||
it('should emit correct "many"', function () { | ||
assert(pluralize(5, '%s корова', '%s коровы', '%s коров'), '5 коров'); | ||
}); | ||
it('should work with formatter', function() { | ||
it('should work with formatter', function () { | ||
var cows = pluralize.formatter('%s корова', '%s коровы', '%s коров'); | ||
@@ -23,0 +23,0 @@ assert(cows(100), '100 коров'); |
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
3540
8
3