META-INF.resources.bower_components.globalize.src.util.to-string.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
The newest version!
define(function () {
/**
* A toString method that outputs meaningful values for objects or arrays and
* still performs as fast as a plain string in case variable is string, or as
* fast as `"" + number` in case variable is a number.
* Ref: http://jsperf.com/my-stringify
*/
return function (variable) {
return typeof variable === "string" ? variable : (typeof variable === "number" ? "" +
variable : JSON.stringify(variable));
};
});