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

canvacord

Package Overview
Dependencies
Maintainers
5
Versions
244
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvacord - npm Package Compare versions

Comparing version 5.4.6 to 5.4.7

4

package.json
{
"name": "canvacord",
"version": "5.4.6",
"version": "5.4.7",
"description": "Powerful image manipulation package for beginners.",

@@ -56,3 +56,3 @@ "main": "index.js",

"dependencies": {
"@napi-rs/canvas": "^0.1.26",
"@napi-rs/canvas": "^0.1.29",
"@skyra/gifenc": "^1.0.0",

@@ -59,0 +59,0 @@ "chalk": "^5.0.1",

module.exports = num => {
if (!num || isNaN(num)) return "0";
if (typeof num === "string") num = parseInt(num);
let decPlaces = Math.pow(10, 1);
var abbrev = ["K", "M", "B", "T"];
for (var i = abbrev.length - 1; i >= 0; i--) {
var size = Math.pow(10, (i + 1) * 3);
if (size <= num) {
num = Math.round((num * decPlaces) / size) / decPlaces;
if (num == 1000 && i < abbrev.length - 1) {
num = 1;
i++;
if (typeof Intl !== "undefined") {
return new Intl.NumberFormat("en", { notation: "compact" }).format(num);
} else {
let decPlaces = Math.pow(10, 1);
var abbrev = ["K", "M", "B", "T"];
for (var i = abbrev.length - 1; i >= 0; i--) {
var size = Math.pow(10, (i + 1) * 3);
if (size <= num) {
num = Math.round((num * decPlaces) / size) / decPlaces;
if (num == 1000 && i < abbrev.length - 1) {
num = 1;
i++;
}
num += abbrev[i];
break;
}
num += abbrev[i];
break;
}
return `${num}`;
}
return `${num}`;
};
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