Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-inflector

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-inflector - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

bower_ember/ember-inflector.js.map

2

bower_ember/bower.json
{
"name": "ember-inflector",
"version": "1.2.0",
"version": "1.3.1",
"dependencies": {

@@ -5,0 +5,0 @@ "ember": ">= 1.0.0 < 2.0.0"

@@ -1,319 +0,11 @@

var define, requireModule, require, requirejs;
(function() {
var registry = {}, seen = {}, state = {};
var FAILED = false;
define = function(name, deps, callback) {
registry[name] = {
deps: deps,
callback: callback
};
};
function reify(deps, name, seen) {
var length = deps.length;
var reified = new Array(length);
var dep;
var exports;
for (var i = 0, l = length; i < l; i++) {
dep = deps[i];
if (dep === 'exports') {
exports = reified[i] = seen;
} else {
reified[i] = require(resolve(dep, name));
}
}
return {
deps: reified,
exports: exports
};
}
requirejs = require = requireModule = function(name) {
if (state[name] !== FAILED &&
seen.hasOwnProperty(name)) {
return seen[name];
}
if (!registry[name]) {
throw new Error('Could not find module ' + name);
}
var mod = registry[name];
var reified;
var module;
var loaded = false;
seen[name] = { }; // placeholder for run-time cycles
try {
reified = reify(mod.deps, name, seen[name]);
module = mod.callback.apply(this, reified.deps);
loaded = true;
} finally {
if (!loaded) {
state[name] = FAILED;
}
}
return reified.exports ? seen[name] : (seen[name] = module);
};
function resolve(child, name) {
if (child.charAt(0) !== '.') { return child; }
var parts = child.split('/');
var nameParts = name.split('/');
var parentBase;
if (nameParts.length === 1) {
parentBase = nameParts;
} else {
parentBase = nameParts.slice(0, -1);
}
for (var i = 0, l = parts.length; i < l; i++) {
var part = parts[i];
if (part === '..') { parentBase.pop(); }
else if (part === '.') { continue; }
else { parentBase.push(part); }
}
return parentBase.join('/');
}
requirejs.entries = requirejs._eak_seen = registry;
requirejs.clear = function(){
requirejs.entries = requirejs._eak_seen = registry = {};
seen = state = {};
};
})();
define("ember-inflector",
["./system","./helpers","./ext/string","exports"],
function(__dependency1__, __dependency2__, __dependency3__, __exports__) {
"use strict";
var Inflector = __dependency1__.Inflector;
var defaultRules = __dependency1__.defaultRules;
var pluralize = __dependency1__.pluralize;
var singularize = __dependency1__.singularize;
var ember$inflector$lib$system$inflector$$capitalize = Ember.String.capitalize;
Inflector.defaultRules = defaultRules;
Ember.Inflector = Inflector;
var ember$inflector$lib$system$inflector$$BLANK_REGEX = /^\s*$/;
var ember$inflector$lib$system$inflector$$LAST_WORD_DASHED_REGEX = /(\w+[_-])([a-z\d]+$)/;
var ember$inflector$lib$system$inflector$$LAST_WORD_CAMELIZED_REGEX = /(\w+)([A-Z][a-z\d]*$)/;
var ember$inflector$lib$system$inflector$$CAMELIZED_REGEX = /[A-Z][a-z\d]*$/;
Ember.String.pluralize = pluralize;
Ember.String.singularize = singularize;
__exports__["default"] = Inflector;
__exports__.pluralize = pluralize;
__exports__.singularize = singularize;
});
define("ember-inflector/ext/string",
["../system/string"],
function(__dependency1__) {
"use strict";
var pluralize = __dependency1__.pluralize;
var singularize = __dependency1__.singularize;
if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
/**
See {{#crossLink "Ember.String/pluralize"}}{{/crossLink}}
@method pluralize
@for String
*/
String.prototype.pluralize = function() {
return pluralize(this);
};
/**
See {{#crossLink "Ember.String/singularize"}}{{/crossLink}}
@method singularize
@for String
*/
String.prototype.singularize = function() {
return singularize(this);
};
}
});
define("ember-inflector/helpers",
["./system/string"],
function(__dependency1__) {
"use strict";
var singularize = __dependency1__.singularize;
var pluralize = __dependency1__.pluralize;
/**
*
* If you have Ember Inflector (such as if Ember Data is present),
* singularize a word. For example, turn "oxen" into "ox".
*
* Example:
*
* {{singularize myProperty}}
* {{singularize "oxen"}}
*
* @for Ember.Handlebars.helpers
* @method singularize
* @param {String|Property} word word to singularize
*/
Ember.Handlebars.helper('singularize', singularize);
/**
*
* If you have Ember Inflector (such as if Ember Data is present),
* pluralize a word. For example, turn "ox" into "oxen".
*
* Example:
*
* {{pluralize count myProperty}}
* {{pluralize 1 "oxen"}}
* {{pluralize myProperty}}
* {{pluralize "ox"}}
*
* @for Ember.Handlebars.helpers
* @method pluralize
* @param {Number|Property} [count] count of objects
* @param {String|Property} word word to pluralize
*/
Ember.Handlebars.helper('pluralize', function(count, word, options) {
if(arguments.length < 3) {
return pluralize(count);
} else {
/* jshint eqeqeq: false */
if(count != 1) {
/* jshint eqeqeq: true */
word = pluralize(word);
}
return count + " " + word;
}
});
});
define("ember-inflector/system",
["./system/inflector","./system/string","./system/inflections","exports"],
function(__dependency1__, __dependency2__, __dependency3__, __exports__) {
"use strict";
var Inflector = __dependency1__["default"];
var pluralize = __dependency2__.pluralize;
var singularize = __dependency2__.singularize;
var defaultRules = __dependency3__["default"];
Inflector.inflector = new Inflector(defaultRules);
__exports__.Inflector = Inflector;
__exports__.singularize = singularize;
__exports__.pluralize = pluralize;
__exports__.defaultRules = defaultRules;
});
define("ember-inflector/system/helpers",
[],
function() {
"use strict";
});
define("ember-inflector/system/inflections",
["exports"],
function(__exports__) {
"use strict";
__exports__["default"] = {
plurals: [
[/$/, 's'],
[/s$/i, 's'],
[/^(ax|test)is$/i, '$1es'],
[/(octop|vir)us$/i, '$1i'],
[/(octop|vir)i$/i, '$1i'],
[/(alias|status)$/i, '$1es'],
[/(bu)s$/i, '$1ses'],
[/(buffal|tomat)o$/i, '$1oes'],
[/([ti])um$/i, '$1a'],
[/([ti])a$/i, '$1a'],
[/sis$/i, 'ses'],
[/(?:([^f])fe|([lr])f)$/i, '$1$2ves'],
[/(hive)$/i, '$1s'],
[/([^aeiouy]|qu)y$/i, '$1ies'],
[/(x|ch|ss|sh)$/i, '$1es'],
[/(matr|vert|ind)(?:ix|ex)$/i, '$1ices'],
[/^(m|l)ouse$/i, '$1ice'],
[/^(m|l)ice$/i, '$1ice'],
[/^(ox)$/i, '$1en'],
[/^(oxen)$/i, '$1'],
[/(quiz)$/i, '$1zes']
],
singular: [
[/s$/i, ''],
[/(ss)$/i, '$1'],
[/(n)ews$/i, '$1ews'],
[/([ti])a$/i, '$1um'],
[/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i, '$1sis'],
[/(^analy)(sis|ses)$/i, '$1sis'],
[/([^f])ves$/i, '$1fe'],
[/(hive)s$/i, '$1'],
[/(tive)s$/i, '$1'],
[/([lr])ves$/i, '$1f'],
[/([^aeiouy]|qu)ies$/i, '$1y'],
[/(s)eries$/i, '$1eries'],
[/(m)ovies$/i, '$1ovie'],
[/(x|ch|ss|sh)es$/i, '$1'],
[/^(m|l)ice$/i, '$1ouse'],
[/(bus)(es)?$/i, '$1'],
[/(o)es$/i, '$1'],
[/(shoe)s$/i, '$1'],
[/(cris|test)(is|es)$/i, '$1is'],
[/^(a)x[ie]s$/i, '$1xis'],
[/(octop|vir)(us|i)$/i, '$1us'],
[/(alias|status)(es)?$/i, '$1'],
[/^(ox)en/i, '$1'],
[/(vert|ind)ices$/i, '$1ex'],
[/(matr)ices$/i, '$1ix'],
[/(quiz)zes$/i, '$1'],
[/(database)s$/i, '$1']
],
irregularPairs: [
['person', 'people'],
['man', 'men'],
['child', 'children'],
['sex', 'sexes'],
['move', 'moves'],
['cow', 'kine'],
['zombie', 'zombies']
],
uncountable: [
'equipment',
'information',
'rice',
'money',
'species',
'series',
'fish',
'sheep',
'jeans',
'police'
]
};
});
define("ember-inflector/system/inflector",
["exports"],
function(__exports__) {
"use strict";
var capitalize = Ember.String.capitalize;
var BLANK_REGEX = /^\s*$/;
var LAST_WORD_DASHED_REGEX = /(\w+[_-])([a-z\d]+$)/;
var LAST_WORD_CAMELIZED_REGEX = /(\w+)([A-Z][a-z\d]*$)/;
var CAMELIZED_REGEX = /[A-Z][a-z\d]*$/;
function loadUncountable(rules, uncountable) {
function ember$inflector$lib$system$inflector$$loadUncountable(rules, uncountable) {
for (var i = 0, length = uncountable.length; i < length; i++) {

@@ -324,3 +16,3 @@ rules.uncountable[uncountable[i].toLowerCase()] = true;

function loadIrregular(rules, irregularPairs) {
function ember$inflector$lib$system$inflector$$loadIrregular(rules, irregularPairs) {
var pair;

@@ -399,6 +91,6 @@

*/
function Inflector(ruleSet) {
function ember$inflector$lib$system$inflector$$Inflector(ruleSet) {
ruleSet = ruleSet || {};
ruleSet.uncountable = ruleSet.uncountable || makeDictionary();
ruleSet.irregularPairs = ruleSet.irregularPairs || makeDictionary();
ruleSet.uncountable = ruleSet.uncountable || ember$inflector$lib$system$inflector$$makeDictionary();
ruleSet.irregularPairs = ruleSet.irregularPairs || ember$inflector$lib$system$inflector$$makeDictionary();

@@ -408,9 +100,9 @@ var rules = this.rules = {

singular: ruleSet.singular || [],
irregular: makeDictionary(),
irregularInverse: makeDictionary(),
uncountable: makeDictionary()
irregular: ember$inflector$lib$system$inflector$$makeDictionary(),
irregularInverse: ember$inflector$lib$system$inflector$$makeDictionary(),
uncountable: ember$inflector$lib$system$inflector$$makeDictionary()
};
loadUncountable(rules, ruleSet.uncountable);
loadIrregular(rules, ruleSet.irregularPairs);
ember$inflector$lib$system$inflector$$loadUncountable(rules, ruleSet.uncountable);
ember$inflector$lib$system$inflector$$loadIrregular(rules, ruleSet.irregularPairs);

@@ -424,3 +116,3 @@ this.enableCache();

function makeDictionary() {
function ember$inflector$lib$system$inflector$$makeDictionary() {
var cache = Object.create(null);

@@ -432,3 +124,3 @@ cache['_dict'] = null;

Inflector.prototype = {
ember$inflector$lib$system$inflector$$Inflector.prototype = {
/**

@@ -463,4 +155,4 @@ @public

this._cacheUsed = false;
this._sCache = makeDictionary();
this._pCache = makeDictionary();
this._sCache = ember$inflector$lib$system$inflector$$makeDictionary();
this._pCache = ember$inflector$lib$system$inflector$$makeDictionary();
},

@@ -512,3 +204,3 @@

if (this._cacheUsed) { this.purgeCache(); }
loadUncountable(this.rules, [string.toLowerCase()]);
ember$inflector$lib$system$inflector$$loadUncountable(this.rules, [string.toLowerCase()]);
},

@@ -523,3 +215,3 @@

if (this._cacheUsed) { this.purgeCache(); }
loadIrregular(this.rules, [[singular, plural]]);
ember$inflector$lib$system$inflector$$loadIrregular(this.rules, [[singular, plural]]);
},

@@ -563,4 +255,4 @@

isBlank = BLANK_REGEX.test(word);
isCamelized = CAMELIZED_REGEX.test(word);
isBlank = ember$inflector$lib$system$inflector$$BLANK_REGEX.test(word);
isCamelized = ember$inflector$lib$system$inflector$$CAMELIZED_REGEX.test(word);
firstPhrase = "";

@@ -573,3 +265,3 @@

lowercase = word.toLowerCase();
wordSplit = LAST_WORD_DASHED_REGEX.exec(word) || LAST_WORD_CAMELIZED_REGEX.exec(word);
wordSplit = ember$inflector$lib$system$inflector$$LAST_WORD_DASHED_REGEX.exec(word) || ember$inflector$lib$system$inflector$$LAST_WORD_CAMELIZED_REGEX.exec(word);
if (wordSplit){

@@ -593,3 +285,3 @@ firstPhrase = wordSplit[1];

else {
isIrregular = (isCamelized) ? capitalize(isIrregular) : isIrregular;
isIrregular = (isCamelized) ? ember$inflector$lib$system$inflector$$capitalize(isIrregular) : isIrregular;
return firstPhrase + isIrregular;

@@ -619,20 +311,179 @@ }

__exports__["default"] = Inflector;
});
define("ember-inflector/system/string",
["./inflector","exports"],
function(__dependency1__, __exports__) {
"use strict";
var Inflector = __dependency1__["default"];
var ember$inflector$lib$system$inflector$$default = ember$inflector$lib$system$inflector$$Inflector;
function pluralize(word) {
return Inflector.inflector.pluralize(word);
function ember$inflector$lib$system$string$$pluralize(word) {
return ember$inflector$lib$system$inflector$$default.inflector.pluralize(word);
}
function singularize(word) {
return Inflector.inflector.singularize(word);
function ember$inflector$lib$system$string$$singularize(word) {
return ember$inflector$lib$system$inflector$$default.inflector.singularize(word);
}
__exports__.pluralize = pluralize;
__exports__.singularize = singularize;
});
if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
/**
See {{#crossLink "Ember.String/pluralize"}}{{/crossLink}}
@method pluralize
@for String
*/
String.prototype.pluralize = function() {
return ember$inflector$lib$system$string$$pluralize(this);
};
/**
See {{#crossLink "Ember.String/singularize"}}{{/crossLink}}
@method singularize
@for String
*/
String.prototype.singularize = function() {
return ember$inflector$lib$system$string$$singularize(this);
};
}
/**
*
* If you have Ember Inflector (such as if Ember Data is present),
* singularize a word. For example, turn "oxen" into "ox".
*
* Example:
*
* {{singularize myProperty}}
* {{singularize "oxen"}}
*
* @for Ember.Handlebars.helpers
* @method singularize
* @param {String|Property} word word to singularize
*/
Ember.Handlebars.helper('singularize', ember$inflector$lib$system$string$$singularize);
/**
*
* If you have Ember Inflector (such as if Ember Data is present),
* pluralize a word. For example, turn "ox" into "oxen".
*
* Example:
*
* {{pluralize count myProperty}}
* {{pluralize 1 "oxen"}}
* {{pluralize myProperty}}
* {{pluralize "ox"}}
*
* @for Ember.Handlebars.helpers
* @method pluralize
* @param {Number|Property} [count] count of objects
* @param {String|Property} word word to pluralize
*/
Ember.Handlebars.helper('pluralize', function(count, word, options) {
if(arguments.length < 3) {
return ember$inflector$lib$system$string$$pluralize(count);
} else {
/* jshint eqeqeq: false */
if(count != 1) {
/* jshint eqeqeq: true */
word = ember$inflector$lib$system$string$$pluralize(word);
}
return count + " " + word;
}
});
var ember$inflector$lib$system$inflections$$default = {
plurals: [
[/$/, 's'],
[/s$/i, 's'],
[/^(ax|test)is$/i, '$1es'],
[/(octop|vir)us$/i, '$1i'],
[/(octop|vir)i$/i, '$1i'],
[/(alias|status)$/i, '$1es'],
[/(bu)s$/i, '$1ses'],
[/(buffal|tomat)o$/i, '$1oes'],
[/([ti])um$/i, '$1a'],
[/([ti])a$/i, '$1a'],
[/sis$/i, 'ses'],
[/(?:([^f])fe|([lr])f)$/i, '$1$2ves'],
[/(hive)$/i, '$1s'],
[/([^aeiouy]|qu)y$/i, '$1ies'],
[/(x|ch|ss|sh)$/i, '$1es'],
[/(matr|vert|ind)(?:ix|ex)$/i, '$1ices'],
[/^(m|l)ouse$/i, '$1ice'],
[/^(m|l)ice$/i, '$1ice'],
[/^(ox)$/i, '$1en'],
[/^(oxen)$/i, '$1'],
[/(quiz)$/i, '$1zes']
],
singular: [
[/s$/i, ''],
[/(ss)$/i, '$1'],
[/(n)ews$/i, '$1ews'],
[/([ti])a$/i, '$1um'],
[/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i, '$1sis'],
[/(^analy)(sis|ses)$/i, '$1sis'],
[/([^f])ves$/i, '$1fe'],
[/(hive)s$/i, '$1'],
[/(tive)s$/i, '$1'],
[/([lr])ves$/i, '$1f'],
[/([^aeiouy]|qu)ies$/i, '$1y'],
[/(s)eries$/i, '$1eries'],
[/(m)ovies$/i, '$1ovie'],
[/(x|ch|ss|sh)es$/i, '$1'],
[/^(m|l)ice$/i, '$1ouse'],
[/(bus)(es)?$/i, '$1'],
[/(o)es$/i, '$1'],
[/(shoe)s$/i, '$1'],
[/(cris|test)(is|es)$/i, '$1is'],
[/^(a)x[ie]s$/i, '$1xis'],
[/(octop|vir)(us|i)$/i, '$1us'],
[/(alias|status)(es)?$/i, '$1'],
[/^(ox)en/i, '$1'],
[/(vert|ind)ices$/i, '$1ex'],
[/(matr)ices$/i, '$1ix'],
[/(quiz)zes$/i, '$1'],
[/(database)s$/i, '$1']
],
irregularPairs: [
['person', 'people'],
['man', 'men'],
['child', 'children'],
['sex', 'sexes'],
['move', 'moves'],
['cow', 'kine'],
['zombie', 'zombies']
],
uncountable: [
'equipment',
'information',
'rice',
'money',
'species',
'series',
'fish',
'sheep',
'jeans',
'police'
]
};
ember$inflector$lib$system$inflector$$default.inflector = new ember$inflector$lib$system$inflector$$default(ember$inflector$lib$system$inflections$$default);
ember$inflector$lib$system$inflector$$default.defaultRules = ember$inflector$lib$system$inflections$$default;
Ember.Inflector = ember$inflector$lib$system$inflector$$default;
Ember.String.pluralize = ember$inflector$lib$system$string$$pluralize;
Ember.String.singularize = ember$inflector$lib$system$string$$singularize;
var ember$inflector$lib$main$$default = ember$inflector$lib$system$inflector$$default;
if (typeof 'define' !== 'undefined' && define.amd){
define('ember-inflector', ['exports'], function(__exports__){
__exports__['default'] = ember$inflector$lib$system$inflector$$default;
return ember$inflector$lib$system$inflector$$default;
});
} else if (typeof module !== 'undefined' && module['exports']){
module['exports'] = ember$inflector$lib$system$inflector$$default;
}
}).call(this);
//# sourceMappingURL=ember-inflector.js.map
{
"name": "ember-inflector",
"version": "1.2.0",
"version": "1.3.1",
"keywords": [
"ember-addon"
],
"devDependencies": {

@@ -10,12 +13,14 @@ "bower": "^1.3.8",

"broccoli-es3-safe-recast": "0.0.8",
"broccoli-es6-module-transpiler": "^0.1.1",
"broccoli-es6-module-transpiler": "^0.5.0",
"broccoli-file-mover": "^0.4.0",
"broccoli-file-remover": "^0.2.2",
"broccoli-jshint": "^0.5.1",
"broccoli-jshint": "^0.5.3",
"broccoli-merge-trees": "^0.1.4",
"broccoli-static-compiler": "^0.1.4",
"broccoli-static-compiler": "^0.2.1",
"broccoli-transform": "^0.1.1",
"broccoli-uglify-js": "^0.1.3",
"broccoli-wrap": "0.0.2",
"ember-cli": "0.0.40",
"ember-cli": "^0.1.3",
"es6-module-transpiler": "^0.9.5",
"es6-module-transpiler-package-resolver": "^1.0.1",
"matchdep": "^0.3.0",

@@ -29,3 +34,6 @@ "testem": "^0.6.17"

"test": "testem ci -R dot"
},
"ember-addon": {
"main": "lib/ember-addon/index.js"
}
}
{
"name": "ember-inflector",
"version": "1.3.0",
"version": "1.3.1",
"dependencies": {

@@ -5,0 +5,0 @@ "ember": ">= 1.0.0 < 2.0.0"

{
"name": "ember-inflector",
"version": "1.3.0",
"version": "1.3.1",
"keywords": [
"ember-addon"
],
"devDependencies": {

@@ -5,0 +8,0 @@ "bower": "^1.3.8",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc