META-INF.resources.bower_components.globalize.dist.globalize-runtime.plural.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwebmp-globalize Show documentation
Show all versions of jwebmp-globalize Show documentation
The JWebSwing implementation for a full Globalization
/**
* Globalize Runtime v1.2.3
*
* http://github.com/jquery/globalize
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-03-17T01:41Z
*/
/*!
* Globalize Runtime v1.2.3 2017-03-17T01:41Z Released under the MIT license
* http://git.io/TrdQbw
*/
(function (root, factory) {
// UMD returnExports
if (typeof define === "function" && define.amd) {
// AMD
define([
"../globalize-runtime"
], factory);
} else if (typeof exports === "object") {
// Node, CommonJS
module.exports = factory(require("../globalize-runtime"));
} else {
// Extend global
factory(root.Globalize);
}
}(this, function (Globalize) {
var runtimeKey = Globalize._runtimeKey,
validateParameterPresence = Globalize._validateParameterPresence,
validateParameterType = Globalize._validateParameterType;
var validateParameterTypeNumber = function (value, name) {
validateParameterType(
value,
name,
value === undefined || typeof value === "number",
"Number"
);
};
var pluralGeneratorFn = function (plural) {
return function pluralGenerator(value) {
validateParameterPresence(value, "value");
validateParameterTypeNumber(value, "value");
return plural(value);
};
};
Globalize._pluralGeneratorFn = pluralGeneratorFn;
Globalize._validateParameterTypeNumber = validateParameterTypeNumber;
Globalize.plural =
Globalize.prototype.plural = function (value, options) {
validateParameterPresence(value, "value");
validateParameterTypeNumber(value, "value");
return this.pluralGenerator(options)(value);
};
Globalize.pluralGenerator =
Globalize.prototype.pluralGenerator = function (options) {
options = options || {};
return Globalize[runtimeKey("pluralGenerator", this._locale, [options])];
};
return Globalize;
}));