Socket
Socket
Sign inDemoInstall

siz

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.0 to 1.2.2

48

index.js

@@ -1,30 +0,32 @@

(function (global, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = factory();
} else {
global.siz = factory();
(function(global, factory) {
if (typeof define === "function" && define.amd) {
define([], factory);
} else if (typeof module !== "undefined" && module.exports) {
module.exports = factory();
} else {
global.siz = factory();
}
})(this, function() {
function siz(size) {
var num = parseInt(size);
if (/[0-9]*k(b|B)?/gi.test(size)) {
return num * 1024;
}
})(this, function () {
function siz(size) {
var num = parseInt(size);
if (/[0-9]*k(b|B)?/ig.test(size)) {
return num * 1024;
}
if (/[0-9]*m(b|B)?/ig.test(size)) {
return num * 1024 * 1024;
}
if (/[0-9]*m(b|B)?/gi.test(size)) {
return num * 1024 * 1024;
}
if (/[0-9]*g(b|B)?/ig.test(size)) {
return num * 1024 * 1024 * 1024;
}
if (/[0-9]*g(b|B)?/gi.test(size)) {
return num * 1024 * 1024 * 1024;
}
if (/[0-9]*t(b|B)?/ig.test(size)) {
return num * 1024 * 1024 * 1024 * 1024;
}
if (/[0-9]*t(b|B)?/gi.test(size)) {
return num * 1024 * 1024 * 1024 * 1024;
}
return siz;
return num;
}
return siz;
});

@@ -8,7 +8,7 @@ {

],
"author": "a-jie <ajiemath@gmail.com>",
"author": "drawcall <ajiemath@gmail.com>",
"main": "index.js",
"version": "1.2.0",
"version": "1.2.2",
"devDependencies": {},
"license": "MIT"
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc