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

filelist-utils

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filelist-utils - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

lib-esm/fileCollectionItemsZip.d.ts

7

lib-esm/FileCollection.d.ts
import { FileCollectionItem } from './FileCollectionItem';
import { FileCollectionItemsZipOptions } from './fileCollectionItemsZip';
export declare class FileCollection {

@@ -6,4 +7,10 @@ readonly files: FileCollectionItem[];

filter(callback: (file: FileCollectionItem) => unknown): FileCollection;
/**
* Zip the FileCollection
* This method returns a new FileCollection that contains only one FileItem that
* is the zipped file (called by default 'file.zip')
*/
zip(options?: FileCollectionItemsZipOptions): Promise<FileCollection>;
[Symbol.iterator](): IterableIterator<FileCollectionItem>;
}
//# sourceMappingURL=FileCollection.d.ts.map

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

import { fileCollectionItemsZip, } from './fileCollectionItemsZip';
export class FileCollection {

@@ -8,2 +9,12 @@ constructor(files) {

}
/**
* Zip the FileCollection
* This method returns a new FileCollection that contains only one FileItem that
* is the zipped file (called by default 'file.zip')
*/
async zip(options = {}) {
return new FileCollection([
await fileCollectionItemsZip(this.files, options),
]);
}
[Symbol.iterator]() {

@@ -10,0 +21,0 @@ return this.files.values();

2

lib-esm/fileCollectionFromFileArray.js

@@ -5,2 +5,3 @@ import fetch from 'cross-fetch';

import { maybeFilter } from './utilities/maybeFilter';
import { sortCollectionItems } from './utilities/sortCollectionItems';
/**

@@ -53,4 +54,5 @@ * Creates a FileCollection from a webservice. This webservice should return an array of objects containing the properties:

fileCollectionItems = await maybeFilter(fileCollectionItems, options);
sortCollectionItems(fileCollectionItems);
return new FileCollection(fileCollectionItems);
}
//# sourceMappingURL=fileCollectionFromFileArray.js.map
import { FileCollection } from './FileCollection';
import { maybeExpand } from './utilities/maybeExpand';
import { maybeFilter } from './utilities/maybeFilter';
import { sortCollectionItems } from './utilities/sortCollectionItems';
/**

@@ -30,4 +31,5 @@ * Generate a FileCollection from a FileList

fileCollectionItems = await maybeFilter(fileCollectionItems, options);
sortCollectionItems(fileCollectionItems);
return new FileCollection(fileCollectionItems);
}
//# sourceMappingURL=fileCollectionFromFileList.js.map
import { FileCollection } from './FileCollection';
import { maybeExpand } from './utilities/maybeExpand';
import { maybeFilter } from './utilities/maybeFilter';
import { sortCollectionItems } from './utilities/sortCollectionItems';
/**

@@ -28,4 +29,5 @@ * Generate a FileCollection from an array of File

fileCollectionItems = await maybeFilter(fileCollectionItems, options);
sortCollectionItems(fileCollectionItems);
return new FileCollection(fileCollectionItems);
}
//# sourceMappingURL=fileCollectionFromFiles.js.map

6

lib-esm/fileCollectionFromPaths.js

@@ -8,2 +8,3 @@ import { createReadStream } from 'node:fs';

import { maybeFilter } from './utilities/maybeFilter';
import { sortCollectionItems } from './utilities/sortCollectionItems';
/**

@@ -21,5 +22,6 @@ * Generate a FileCollection from a directory path

await appendFiles(fileCollectionItems, path, base);
fileCollectionItems = await maybeExpand(fileCollectionItems, options);
fileCollectionItems = await maybeFilter(fileCollectionItems, options);
}
fileCollectionItems = await maybeExpand(fileCollectionItems, options);
fileCollectionItems = await maybeFilter(fileCollectionItems, options);
sortCollectionItems(fileCollectionItems);
return new FileCollection(fileCollectionItems);

@@ -26,0 +28,0 @@ }

import { FileCollectionItem } from './FileCollectionItem';
import { FileCollectionItemsZipOptions } from './fileCollectionItemsZip';
export declare class FileCollection {

@@ -6,4 +7,10 @@ readonly files: FileCollectionItem[];

filter(callback: (file: FileCollectionItem) => unknown): FileCollection;
/**
* Zip the FileCollection
* This method returns a new FileCollection that contains only one FileItem that
* is the zipped file (called by default 'file.zip')
*/
zip(options?: FileCollectionItemsZipOptions): Promise<FileCollection>;
[Symbol.iterator](): IterableIterator<FileCollectionItem>;
}
//# sourceMappingURL=FileCollection.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FileCollection = void 0;
const fileCollectionItemsZip_1 = require("./fileCollectionItemsZip");
class FileCollection {

@@ -11,2 +12,12 @@ constructor(files) {

}
/**
* Zip the FileCollection
* This method returns a new FileCollection that contains only one FileItem that
* is the zipped file (called by default 'file.zip')
*/
async zip(options = {}) {
return new FileCollection([
await (0, fileCollectionItemsZip_1.fileCollectionItemsZip)(this.files, options),
]);
}
[Symbol.iterator]() {

@@ -13,0 +24,0 @@ return this.files.values();

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

const maybeFilter_1 = require("./utilities/maybeFilter");
const sortCollectionItems_1 = require("./utilities/sortCollectionItems");
/**

@@ -59,2 +60,3 @@ * Creates a FileCollection from a webservice. This webservice should return an array of objects containing the properties:

fileCollectionItems = await (0, maybeFilter_1.maybeFilter)(fileCollectionItems, options);
(0, sortCollectionItems_1.sortCollectionItems)(fileCollectionItems);
return new FileCollection_1.FileCollection(fileCollectionItems);

@@ -61,0 +63,0 @@ }

@@ -7,2 +7,3 @@ "use strict";

const maybeFilter_1 = require("./utilities/maybeFilter");
const sortCollectionItems_1 = require("./utilities/sortCollectionItems");
/**

@@ -34,2 +35,3 @@ * Generate a FileCollection from a FileList

fileCollectionItems = await (0, maybeFilter_1.maybeFilter)(fileCollectionItems, options);
(0, sortCollectionItems_1.sortCollectionItems)(fileCollectionItems);
return new FileCollection_1.FileCollection(fileCollectionItems);

@@ -36,0 +38,0 @@ }

@@ -7,2 +7,3 @@ "use strict";

const maybeFilter_1 = require("./utilities/maybeFilter");
const sortCollectionItems_1 = require("./utilities/sortCollectionItems");
/**

@@ -32,2 +33,3 @@ * Generate a FileCollection from an array of File

fileCollectionItems = await (0, maybeFilter_1.maybeFilter)(fileCollectionItems, options);
(0, sortCollectionItems_1.sortCollectionItems)(fileCollectionItems);
return new FileCollection_1.FileCollection(fileCollectionItems);

@@ -34,0 +36,0 @@ }

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

const maybeFilter_1 = require("./utilities/maybeFilter");
const sortCollectionItems_1 = require("./utilities/sortCollectionItems");
/**

@@ -24,5 +25,6 @@ * Generate a FileCollection from a directory path

await appendFiles(fileCollectionItems, path, base);
fileCollectionItems = await (0, maybeExpand_1.maybeExpand)(fileCollectionItems, options);
fileCollectionItems = await (0, maybeFilter_1.maybeFilter)(fileCollectionItems, options);
}
fileCollectionItems = await (0, maybeExpand_1.maybeExpand)(fileCollectionItems, options);
fileCollectionItems = await (0, maybeFilter_1.maybeFilter)(fileCollectionItems, options);
(0, sortCollectionItems_1.sortCollectionItems)(fileCollectionItems);
return new FileCollection_1.FileCollection(fileCollectionItems);

@@ -29,0 +31,0 @@ }

{
"name": "filelist-utils",
"version": "1.3.0",
"version": "1.4.0",
"description": "Create a FileCollection from a path or a zip file",

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

import { FileCollectionItem } from './FileCollectionItem';
import {
fileCollectionItemsZip,
FileCollectionItemsZipOptions,
} from './fileCollectionItemsZip';

@@ -14,2 +18,13 @@ export class FileCollection {

/**
* Zip the FileCollection
* This method returns a new FileCollection that contains only one FileItem that
* is the zipped file (called by default 'file.zip')
*/
async zip(options: FileCollectionItemsZipOptions = {}) {
return new FileCollection([
await fileCollectionItemsZip(this.files, options),
]);
}
[Symbol.iterator]() {

@@ -16,0 +31,0 @@ return this.files.values();

@@ -8,2 +8,3 @@ import fetch from 'cross-fetch';

import { FilterOptions, maybeFilter } from './utilities/maybeFilter';
import { sortCollectionItems } from './utilities/sortCollectionItems';

@@ -66,3 +67,4 @@ /**

fileCollectionItems = await maybeFilter(fileCollectionItems, options);
sortCollectionItems(fileCollectionItems);
return new FileCollection(fileCollectionItems);
}

@@ -6,2 +6,3 @@ import { ExpandOptions } from './ExpandOptions';

import { FilterOptions, maybeFilter } from './utilities/maybeFilter';
import { sortCollectionItems } from './utilities/sortCollectionItems';

@@ -39,4 +40,4 @@ /**

fileCollectionItems = await maybeFilter(fileCollectionItems, options);
sortCollectionItems(fileCollectionItems);
return new FileCollection(fileCollectionItems);
}

@@ -6,2 +6,3 @@ import { ExpandOptions } from './ExpandOptions';

import { FilterOptions, maybeFilter } from './utilities/maybeFilter';
import { sortCollectionItems } from './utilities/sortCollectionItems';

@@ -37,4 +38,4 @@ /**

fileCollectionItems = await maybeFilter(fileCollectionItems, options);
sortCollectionItems(fileCollectionItems);
return new FileCollection(fileCollectionItems);
}

@@ -11,2 +11,3 @@ import { createReadStream } from 'node:fs';

import { FilterOptions, maybeFilter } from './utilities/maybeFilter';
import { sortCollectionItems } from './utilities/sortCollectionItems';

@@ -29,6 +30,6 @@ /**

await appendFiles(fileCollectionItems, path, base);
fileCollectionItems = await maybeExpand(fileCollectionItems, options);
fileCollectionItems = await maybeFilter(fileCollectionItems, options);
}
fileCollectionItems = await maybeExpand(fileCollectionItems, options);
fileCollectionItems = await maybeFilter(fileCollectionItems, options);
sortCollectionItems(fileCollectionItems);
return new FileCollection(fileCollectionItems);

@@ -35,0 +36,0 @@ }

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

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

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

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