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

@spinajs/fs

Package Overview
Dependencies
Maintainers
0
Versions
259
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spinajs/fs - npm Package Compare versions

Comparing version 2.0.290 to 2.0.291

4

lib/cjs/interfaces.d.ts

@@ -227,3 +227,3 @@ /// <reference types="node" />

*
* Compress specified file or dir in provided path. If
* Compress specified file or dir in provided path.
* Dir is compressed recursively

@@ -234,3 +234,3 @@ *

*/
static zip(path: string, dstFs?: fs, dstFile?: string): Promise<IZipResult>;
static zip(path: string | string[], dstFile?: string, dstFs?: fs): Promise<IZipResult>;
/**

@@ -237,0 +237,0 @@ * Decompress given file to destination path

@@ -11,3 +11,3 @@ "use strict";

if (!reg.test(path)) {
throw new exceptions_1.InvalidArgument(`path is not valid filesystem URI`);
return [null, path];
}

@@ -167,3 +167,3 @@ const args = reg.exec(path)[2].split('/');

*
* Compress specified file or dir in provided path. If
* Compress specified file or dir in provided path.
* Dir is compressed recursively

@@ -174,6 +174,7 @@ *

*/
static zip(path, dstFs, dstFile) {
const [fs, p] = uriToFs(path);
static zip(path, dstFile, dstFs) {
const [fs] = !Array.isArray(path) ? uriToFs(path) : uriToFs(path[0]);
const [dFs, fP] = uriToFs(dstFile);
return fs.zip(p, dFs ?? dstFs, fP);
const files = Array.isArray(path) ? path.map((x) => uriToFs(x)[1]) : uriToFs(path)[1];
return fs.zip(files, dFs ?? dstFs, fP ?? dstFile);
}

@@ -180,0 +181,0 @@ /**

@@ -227,3 +227,3 @@ /// <reference types="node" resolution-mode="require"/>

*
* Compress specified file or dir in provided path. If
* Compress specified file or dir in provided path.
* Dir is compressed recursively

@@ -234,3 +234,3 @@ *

*/
static zip(path: string, dstFs?: fs, dstFile?: string): Promise<IZipResult>;
static zip(path: string | string[], dstFile?: string, dstFs?: fs): Promise<IZipResult>;
/**

@@ -237,0 +237,0 @@ * Decompress given file to destination path

/* eslint-disable security/detect-non-literal-fs-filename */
import { AsyncService, DI } from '@spinajs/di';
import { InvalidArgument, IOFail } from '@spinajs/exceptions';
import { IOFail } from '@spinajs/exceptions';
import { v4 as uuidv4 } from 'uuid';

@@ -8,3 +8,3 @@ function uriToFs(path) {

if (!reg.test(path)) {
throw new InvalidArgument(`path is not valid filesystem URI`);
return [null, path];
}

@@ -164,3 +164,3 @@ const args = reg.exec(path)[2].split('/');

*
* Compress specified file or dir in provided path. If
* Compress specified file or dir in provided path.
* Dir is compressed recursively

@@ -171,6 +171,7 @@ *

*/
static zip(path, dstFs, dstFile) {
const [fs, p] = uriToFs(path);
static zip(path, dstFile, dstFs) {
const [fs] = !Array.isArray(path) ? uriToFs(path) : uriToFs(path[0]);
const [dFs, fP] = uriToFs(dstFile);
return fs.zip(p, dFs ?? dstFs, fP);
const files = Array.isArray(path) ? path.map((x) => uriToFs(x)[1]) : uriToFs(path)[1];
return fs.zip(files, dFs ?? dstFs, fP ?? dstFile);
}

@@ -177,0 +178,0 @@ /**

{
"name": "@spinajs/fs",
"version": "2.0.290",
"version": "2.0.291",
"description": "wrapper for file operations",

@@ -55,5 +55,5 @@ "main": "lib/cjs/index.js",

"dependencies": {
"@spinajs/exceptions": "2.0.290",
"@spinajs/util": "2.0.290",
"@spinajs/log-common": "2.0.290",
"@spinajs/exceptions": "2.0.291",
"@spinajs/util": "2.0.291",
"@spinajs/log-common": "2.0.291",
"archiver": "^5.3.1",

@@ -60,0 +60,0 @@ "lodash": "^4.17.21",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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