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 0.10.0 to 0.11.0

2

lib-esm/FileCollection.d.ts
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'],

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