filelist-utils
Advanced tools
Comparing version 1.3.0 to 1.4.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 |
@@ -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(); |
@@ -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 |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
153225
210
2387