filelist-utils
Advanced tools
Comparing version 0.10.0 to 0.11.0
import { FileCollectionItem } from './FileCollectionItem'; | ||
export declare class FileCollection { | ||
readonly items: FileCollectionItem[]; | ||
readonly files: FileCollectionItem[]; | ||
constructor(files: FileCollectionItem[]); | ||
@@ -5,0 +5,0 @@ [Symbol.iterator](): IterableIterator<FileCollectionItem>; |
export class FileCollection { | ||
constructor(files) { | ||
this.items = files; | ||
this.files = files; | ||
} | ||
[Symbol.iterator]() { | ||
return this.items.values(); | ||
return this.files.values(); | ||
} | ||
} | ||
//# sourceMappingURL=FileCollection.js.map |
import { FileCollection } from './FileCollection'; | ||
export function groupFiles(fileCollection, options = {}) { | ||
const { groupBy = 'baseDir', meta } = options; | ||
const fileCollectionItems = fileCollection.items; | ||
const fileCollectionItems = fileCollection.files; | ||
let results = {}; | ||
@@ -6,0 +6,0 @@ for (const file of fileCollectionItems) { |
@@ -7,3 +7,3 @@ import { join } from 'path'; | ||
const normalFileCollection = await fileCollectionFromPath(join(__dirname, '../__tests__/dataUngzip')); | ||
const fileCollectionUngzipped = await fileCollectionItemsUngzip(normalFileCollection.items); | ||
const fileCollectionUngzipped = await fileCollectionItemsUngzip(normalFileCollection.files); | ||
const files = Array.from(fileCollectionUngzipped.map((a) => `${a.relativePath} - ${a.name}`)); | ||
@@ -10,0 +10,0 @@ expect(files).toStrictEqual([ |
@@ -7,3 +7,3 @@ import { join } from 'path'; | ||
const normalFileCollection = await fileCollectionFromPath(join(__dirname, '../__tests__/dataUnzip')); | ||
const fileCollectionUnzipped = await fileCollectionItemsUnzip(normalFileCollection.items); | ||
const fileCollectionUnzipped = await fileCollectionItemsUnzip(normalFileCollection.files); | ||
expect(Array.from(fileCollectionUnzipped.map((a) => `${a.relativePath} - ${a.name}`))).toStrictEqual([ | ||
@@ -31,3 +31,3 @@ 'dataUnzip/data.zip/data/c.txt - c.txt', | ||
const normalFileCollection = await fileCollectionFromPath(join(__dirname, '../__tests__/dataUnzip')); | ||
const fileCollectionUnzipped = await fileCollectionItemsUnzip(normalFileCollection.items, { | ||
const fileCollectionUnzipped = await fileCollectionItemsUnzip(normalFileCollection.files, { | ||
zipExtensions: ['zip', 'zipped'], | ||
@@ -58,3 +58,3 @@ }); | ||
const normalFileCollection = await fileCollectionFromPath(join(__dirname, '../__tests__/dataUnzip')); | ||
const fileCollectionUnzipped = await fileCollectionItemsUnzip(normalFileCollection.items, { | ||
const fileCollectionUnzipped = await fileCollectionItemsUnzip(normalFileCollection.files, { | ||
zipExtensions: ['txt', 'zip', 'zipped'], | ||
@@ -61,0 +61,0 @@ }); |
import { FileCollectionItem } from './FileCollectionItem'; | ||
export declare class FileCollection { | ||
readonly items: FileCollectionItem[]; | ||
readonly files: FileCollectionItem[]; | ||
constructor(files: FileCollectionItem[]); | ||
@@ -5,0 +5,0 @@ [Symbol.iterator](): IterableIterator<FileCollectionItem>; |
@@ -6,6 +6,6 @@ "use strict"; | ||
constructor(files) { | ||
this.items = files; | ||
this.files = files; | ||
} | ||
[Symbol.iterator]() { | ||
return this.items.values(); | ||
return this.files.values(); | ||
} | ||
@@ -12,0 +12,0 @@ } |
@@ -7,3 +7,3 @@ "use strict"; | ||
const { groupBy = 'baseDir', meta } = options; | ||
const fileCollectionItems = fileCollection.items; | ||
const fileCollectionItems = fileCollection.files; | ||
let results = {}; | ||
@@ -10,0 +10,0 @@ for (const file of fileCollectionItems) { |
@@ -9,3 +9,3 @@ "use strict"; | ||
const normalFileCollection = await (0, fileCollectionFromPath_1.fileCollectionFromPath)((0, path_1.join)(__dirname, '../__tests__/dataUngzip')); | ||
const fileCollectionUngzipped = await (0, fileCollectionItemsUngzip_1.fileCollectionItemsUngzip)(normalFileCollection.items); | ||
const fileCollectionUngzipped = await (0, fileCollectionItemsUngzip_1.fileCollectionItemsUngzip)(normalFileCollection.files); | ||
const files = Array.from(fileCollectionUngzipped.map((a) => `${a.relativePath} - ${a.name}`)); | ||
@@ -12,0 +12,0 @@ expect(files).toStrictEqual([ |
@@ -9,3 +9,3 @@ "use strict"; | ||
const normalFileCollection = await (0, fileCollectionFromPath_1.fileCollectionFromPath)((0, path_1.join)(__dirname, '../__tests__/dataUnzip')); | ||
const fileCollectionUnzipped = await (0, fileCollectionItemsUnzip_1.fileCollectionItemsUnzip)(normalFileCollection.items); | ||
const fileCollectionUnzipped = await (0, fileCollectionItemsUnzip_1.fileCollectionItemsUnzip)(normalFileCollection.files); | ||
expect(Array.from(fileCollectionUnzipped.map((a) => `${a.relativePath} - ${a.name}`))).toStrictEqual([ | ||
@@ -33,3 +33,3 @@ 'dataUnzip/data.zip/data/c.txt - c.txt', | ||
const normalFileCollection = await (0, fileCollectionFromPath_1.fileCollectionFromPath)((0, path_1.join)(__dirname, '../__tests__/dataUnzip')); | ||
const fileCollectionUnzipped = await (0, fileCollectionItemsUnzip_1.fileCollectionItemsUnzip)(normalFileCollection.items, { | ||
const fileCollectionUnzipped = await (0, fileCollectionItemsUnzip_1.fileCollectionItemsUnzip)(normalFileCollection.files, { | ||
zipExtensions: ['zip', 'zipped'], | ||
@@ -60,3 +60,3 @@ }); | ||
const normalFileCollection = await (0, fileCollectionFromPath_1.fileCollectionFromPath)((0, path_1.join)(__dirname, '../__tests__/dataUnzip')); | ||
const fileCollectionUnzipped = await (0, fileCollectionItemsUnzip_1.fileCollectionItemsUnzip)(normalFileCollection.items, { | ||
const fileCollectionUnzipped = await (0, fileCollectionItemsUnzip_1.fileCollectionItemsUnzip)(normalFileCollection.files, { | ||
zipExtensions: ['txt', 'zip', 'zipped'], | ||
@@ -63,0 +63,0 @@ }); |
{ | ||
"name": "filelist-utils", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"description": "Create a FileCollection from a path or a zip file", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
import { FileCollectionItem } from './FileCollectionItem'; | ||
export class FileCollection { | ||
readonly items: FileCollectionItem[]; | ||
readonly files: FileCollectionItem[]; | ||
constructor(files: FileCollectionItem[]) { | ||
this.items = files; | ||
this.files = files; | ||
} | ||
[Symbol.iterator]() { | ||
return this.items.values(); | ||
return this.files.values(); | ||
} | ||
} |
@@ -42,3 +42,3 @@ import { FileCollection } from './FileCollection'; | ||
const fileCollectionItems: FileCollectionItem[] = fileCollection.items; | ||
const fileCollectionItems: FileCollectionItem[] = fileCollection.files; | ||
@@ -45,0 +45,0 @@ let results: Record<string, GroupOfFiles> = {}; |
@@ -12,3 +12,3 @@ import { join } from 'path'; | ||
const fileCollectionUngzipped = await fileCollectionItemsUngzip( | ||
normalFileCollection.items, | ||
normalFileCollection.files, | ||
); | ||
@@ -15,0 +15,0 @@ |
@@ -12,3 +12,3 @@ import { join } from 'path'; | ||
const fileCollectionUnzipped = await fileCollectionItemsUnzip( | ||
normalFileCollection.items, | ||
normalFileCollection.files, | ||
); | ||
@@ -46,3 +46,3 @@ | ||
const fileCollectionUnzipped = await fileCollectionItemsUnzip( | ||
normalFileCollection.items, | ||
normalFileCollection.files, | ||
{ | ||
@@ -85,3 +85,3 @@ zipExtensions: ['zip', 'zipped'], | ||
const fileCollectionUnzipped = await fileCollectionItemsUnzip( | ||
normalFileCollection.items, | ||
normalFileCollection.files, | ||
{ | ||
@@ -88,0 +88,0 @@ zipExtensions: ['txt', 'zip', 'zipped'], |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
3