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

@platform/fs

Package Overview
Dependencies
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@platform/fs - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

41

lib/size/size.js

@@ -34,16 +34,35 @@ "use strict";

return tslib_1.__awaiter(this, void 0, void 0, function () {
var pattern, wait, files, bytes;
var exists, getFiles, files, _a, bytes;
var _this = this;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
pattern = path_1.resolve(path_1.join(path), '**');
return [4, glob_1.glob.find(pattern)];
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0: return [4, fsExtra.pathExists(path)];
case 1:
wait = (_a.sent()).map(function (path) { return tslib_1.__awaiter(_this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) {
return [2, exports.size.file(path)];
}); }); });
return [4, Promise.all(wait)];
exists = _b.sent();
getFiles = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
var pattern, wait;
var _this = this;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
pattern = path_1.resolve(path_1.join(path), '**');
return [4, glob_1.glob.find(pattern)];
case 1:
wait = (_a.sent()).map(function (path) { return tslib_1.__awaiter(_this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) {
return [2, exports.size.file(path)];
}); }); });
return [2, Promise.all(wait)];
}
});
}); };
if (!exists) return [3, 3];
return [4, getFiles()];
case 2:
files = _a.sent();
_a = _b.sent();
return [3, 4];
case 3:
_a = [];
_b.label = 4;
case 4:
files = _a;
bytes = files.reduce(function (acc, next) { return acc + next.bytes; }, 0);

@@ -50,0 +69,0 @@ return [2, {

{
"name": "@platform/fs",
"version": "0.1.4",
"version": "0.1.5",
"description": "File system tools.",

@@ -19,3 +19,3 @@ "main": "lib/index",

"extract-zip": "1.6.7",
"fast-glob": "2.2.7",
"fast-glob": "3.0.2",
"filesize": "^4.1.2",

@@ -26,4 +26,4 @@ "fs-extra": "8.0.1",

"devDependencies": {
"@platform/test": "0.0.57",
"@platform/ts.libs": "3.5.2",
"@platform/test": "0.0.58",
"@platform/ts.libs": "3.5.3",
"@types/archiver": "3.0.0",

@@ -30,0 +30,0 @@ "@types/extract-zip": "1.6.2",

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