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

kitten-format

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kitten-format - npm Package Compare versions

Comparing version 1.4.2 to 1.4.3

10

kittenFormat.client.js

@@ -135,3 +135,3 @@ (function (global, factory) {

if (typeof value === 'string') {
if (typeof value === 'string' && isNaN(value)) {
return '-';

@@ -160,3 +160,3 @@ }

if (typeof value === 'string') {
if (typeof value === 'string' && isNaN(value)) {
return '-';

@@ -224,3 +224,3 @@ }

if (typeof value === 'string') {
if (typeof value === 'string' && isNaN(value)) {
return '-';

@@ -326,3 +326,3 @@ }

if (typeof value === 'string') {
if (typeof value === 'string' && isNaN(value)) {
return '-';

@@ -352,3 +352,3 @@ }

if (typeof value === 'string') {
if (typeof value === 'string' && isNaN(value)) {
return '-';

@@ -355,0 +355,0 @@ }

@@ -1,1 +0,1 @@

!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r=r||self).kittenFormat=e()}(this,function(){"use strict";var r={default:{locale:"fr-FR",currency:"EUR",precision:2,unitPrefixes:{15:{default:"P",g:"GT"},12:{default:"T",g:"MT"},9:{default:"G",g:"kT"},6:{default:"M",g:"T"},3:"k",0:"","-3":"m","-6":"μ","-9":"n"}}};function e(e){r.default=e}function n(e){return r[e]?r[e]:r.default}var t={};function a(r,e){if(null==r)return r;if("string"==typeof r)return"-";var a,u,o,i=n((e=e||{}).locale),l=e.precision||i.precision,f=e.locale||i.locale;return(a=f,u=l,o=a+":"+u,t[o]||(t[o]=new Intl.NumberFormat(a,{maximumFractionDigits:u})),t[o]).format(r)}function u(r,e){if(null==r)return r;if("string"==typeof r)return"-";var t=null===(e=e||{}).power||void 0===e.power?0:e.power,u=e.unit;if(!u)return r;var o=0,i=0;if(r<1)o=r*Math.pow(10,3),-0===(t-=3)&&(t=0);else{var l=(r+"").split(".")[0].length;0!==(i=4*Math.trunc(l/4))&&i--,o=r*Math.pow(10,-i)}var f=n(e.locale).unitPrefixes,c=a(o,e),s=f[i+t];return void 0===s?s="10^"+(i+t)+u:"string"!=typeof s?s=s[u]||s.default:s+=u,c+" "+s}function o(r){return null==r||"string"!=typeof r?r:r.toLowerCase()}var i={};i.setOptions=e,i.locale=function(n){if(n){r[n.locale]=n;var t=function(){var r=null;r=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.userLanguage?navigator.userLanguage:navigator.language;var e={en:"en-GB",fr:"fr-FR"};return e[r]&&(r=e[r]),r}();t!==r.default.locale&&r[t]&&e(r[t])}},i.averageN=u,i.averageNumber=u,i.lowerCase=o,i.upperCase=function(r){return null==r||"string"!=typeof r?r:r.toUpperCase()},i.upperCaseFirstChar=function(r){return null!=r&&"string"==typeof r&&r.length?r[0].toUpperCase()+o(r.slice(1,r.length)):r};var l={};function f(r,e){if(null==r)return r;if("string"==typeof r)return"-";var t=n((e=e||{}).locale),a=e.precision||t.precision,u=e.currency||t.currency;return function(r,e,n){n<2&&(n=2);var t=r+":"+e+":"+n;return l[t]||(l[t]=new Intl.NumberFormat(r,{maximumFractionDigits:n,currency:e,style:"currency"})),l[t]}(e.locale||t.locale,u,a).format(r)}function c(r,e){if(null==r)return r;if("string"==typeof r)return"-";var t=n((e=e||{}).locale),a=e.source||t.currency,u=e.target,o=e.rates;return!u||!o||o&&!o[a]||o&&!o[u]?r:r/o[a]*o[u]}return i.formatC=f,i.formatCurrency=f,i.convC=c,i.convertCurrency=c,i.formatN=a,i.formatNumber=a,i.percent=function(r,e){if(null==r)return r;if("string"==typeof r)return"-";var n=100*r;return r>1&&(n=r),a(n,e)+"%"},i});
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r=r||self).kittenFormat=e()}(this,function(){"use strict";var r={default:{locale:"fr-FR",currency:"EUR",precision:2,unitPrefixes:{15:{default:"P",g:"GT"},12:{default:"T",g:"MT"},9:{default:"G",g:"kT"},6:{default:"M",g:"T"},3:"k",0:"","-3":"m","-6":"μ","-9":"n"}}};function e(e){r.default=e}function n(e){return r[e]?r[e]:r.default}var t={};function a(r,e){if(null==r)return r;if("string"==typeof r&&isNaN(r))return"-";var a,u,i,o=n((e=e||{}).locale),l=e.precision||o.precision,f=e.locale||o.locale;return(a=f,u=l,i=a+":"+u,t[i]||(t[i]=new Intl.NumberFormat(a,{maximumFractionDigits:u})),t[i]).format(r)}function u(r,e){if(null==r)return r;if("string"==typeof r&&isNaN(r))return"-";var t=null===(e=e||{}).power||void 0===e.power?0:e.power,u=e.unit;if(!u)return r;var i=0,o=0;if(r<1)i=r*Math.pow(10,3),-0===(t-=3)&&(t=0);else{var l=(r+"").split(".")[0].length;0!==(o=4*Math.trunc(l/4))&&o--,i=r*Math.pow(10,-o)}var f=n(e.locale).unitPrefixes,c=a(i,e),s=f[o+t];return void 0===s?s="10^"+(o+t)+u:"string"!=typeof s?s=s[u]||s.default:s+=u,c+" "+s}function i(r){return null==r||"string"!=typeof r?r:r.toLowerCase()}var o={};o.setOptions=e,o.locale=function(n){if(n){r[n.locale]=n;var t=function(){var r=null;r=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.userLanguage?navigator.userLanguage:navigator.language;var e={en:"en-GB",fr:"fr-FR"};return e[r]&&(r=e[r]),r}();t!==r.default.locale&&r[t]&&e(r[t])}},o.averageN=u,o.averageNumber=u,o.lowerCase=i,o.upperCase=function(r){return null==r||"string"!=typeof r?r:r.toUpperCase()},o.upperCaseFirstChar=function(r){return null!=r&&"string"==typeof r&&r.length?r[0].toUpperCase()+i(r.slice(1,r.length)):r};var l={};function f(r,e){if(null==r)return r;if("string"==typeof r&&isNaN(r))return"-";var t=n((e=e||{}).locale),a=e.precision||t.precision,u=e.currency||t.currency;return function(r,e,n){n<2&&(n=2);var t=r+":"+e+":"+n;return l[t]||(l[t]=new Intl.NumberFormat(r,{maximumFractionDigits:n,currency:e,style:"currency"})),l[t]}(e.locale||t.locale,u,a).format(r)}function c(r,e){if(null==r)return r;if("string"==typeof r&&isNaN(r))return"-";var t=n((e=e||{}).locale),a=e.source||t.currency,u=e.target,i=e.rates;return!u||!i||i&&!i[a]||i&&!i[u]?r:r/i[a]*i[u]}return o.formatC=f,o.formatCurrency=f,o.convC=c,o.convertCurrency=c,o.formatN=a,o.formatNumber=a,o.percent=function(r,e){if(null==r)return r;if("string"==typeof r&&isNaN(r))return"-";var n=100*r;return r>1&&(n=r),a(n,e)+"%"},o});
{
"name": "kitten-format",
"version": "1.4.2",
"version": "1.4.3",
"description": "Fast formatters for browsers",

@@ -14,3 +14,4 @@ "main": "kittenFormat.client.js",

"url": "git+https://github.com/Ideolys/kitten-format.git"
}
},
"dependencies": {}
}
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