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

@yarnpkg/fslib

Package Overview
Dependencies
Maintainers
6
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yarnpkg/fslib - npm Package Compare versions

Comparing version 3.0.0-rc.21 to 3.0.0-rc.22

10

lib/algorithms/copyPromise.d.ts
import { FakeFS } from '../FakeFS';
import { Path } from '../path';
export declare type HardlinkFromIndexStrategy<P> = {
export type HardlinkFromIndexStrategy<P> = {
type: `HardlinkFromIndex`;

@@ -9,4 +9,4 @@ indexPath: P;

};
export declare type LinkStrategy<P> = HardlinkFromIndexStrategy<P>;
export declare type CopyOptions<P> = {
export type LinkStrategy<P> = HardlinkFromIndexStrategy<P>;
export type CopyOptions<P> = {
linkStrategy: LinkStrategy<P> | null;

@@ -17,5 +17,5 @@ stableTime: boolean;

};
export declare type Operations = Array<() => Promise<void>>;
export declare type LUTimes<P extends Path> = Array<[P, Date | number, Date | number]>;
export type Operations = Array<() => Promise<void>>;
export type LUTimes<P extends Path> = Array<[P, Date | number, Date | number]>;
export declare function setupCopyIndex<P extends Path>(destinationFs: FakeFS<P>, linkStrategy: Pick<HardlinkFromIndexStrategy<P>, `indexPath`>): Promise<P>;
export declare function copyPromise<P1 extends Path, P2 extends Path>(destinationFs: FakeFS<P1>, destination: P1, sourceFs: FakeFS<P2>, source: P2, opts: CopyOptions<P1>): Promise<void>;

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

import { Filename, Path } from '../path';
export declare type CustomDirOptions = {
export type CustomDirOptions = {
onClose?: () => void;

@@ -9,0 +9,0 @@ };

@@ -18,4 +18,4 @@ /// <reference types="node" />

export declare function assertStatus<T extends Status>(current: Status, expected: T): asserts current is T;
export declare type ListenerOptions = Omit<Required<WatchFileOptions>, 'bigint'>;
export declare type CustomStatWatcherOptions = {
export type ListenerOptions = Omit<Required<WatchFileOptions>, 'bigint'>;
export type CustomStatWatcherOptions = {
bigint?: boolean;

@@ -22,0 +22,0 @@ };

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

class CustomStatWatcher extends events_1.EventEmitter {
static create(fakeFs, path, opts) {
const statWatcher = new CustomStatWatcher(fakeFs, path, opts);
statWatcher.start();
return statWatcher;
}
constructor(fakeFs, path, { bigint = false } = {}) {

@@ -36,7 +41,2 @@ super();

}
static create(fakeFs, path, opts) {
const statWatcher = new CustomStatWatcher(fakeFs, path, opts);
statWatcher.start();
return statWatcher;
}
start() {

@@ -43,0 +43,0 @@ assertStatus(this.status, Status.Ready);

import { FakeFS } from './FakeFS';
import { ProxiedFS } from './ProxiedFS';
import { Path, PathUtils } from './path';
export declare type AliasFSOptions<P extends Path> = {
export type AliasFSOptions<P extends Path> = {
baseFs: FakeFS<P>;

@@ -6,0 +6,0 @@ pathUtils: PathUtils<P>;

import { FakeFS } from './FakeFS';
import { ProxiedFS } from './ProxiedFS';
import { PortablePath } from './path';
export declare type CwdFSOptions = {
export type CwdFSOptions = {
baseFs?: FakeFS<PortablePath>;

@@ -6,0 +6,0 @@ };

@@ -11,13 +11,13 @@ /// <reference types="node" />

import { FSPath, Path, PortablePath, PathUtils, Filename } from './path';
export declare type BufferEncodingOrBuffer = BufferEncoding | 'buffer';
export declare type Stats = NodeStats & {
export type BufferEncodingOrBuffer = BufferEncoding | 'buffer';
export type Stats = NodeStats & {
crc?: number;
};
export declare type BigIntStats = NodeBigIntStats & {
export type BigIntStats = NodeBigIntStats & {
crc?: number;
};
export declare type Dirent = Exclude<NodeDirent, 'name'> & {
export type Dirent = Exclude<NodeDirent, 'name'> & {
name: Filename;
};
export declare type Dir<P extends Path> = {
export type Dir<P extends Path> = {
readonly path: P;

@@ -32,10 +32,10 @@ [Symbol.asyncIterator](): AsyncIterableIterator<Dirent>;

};
export declare type OpendirOptions = Partial<{
export type OpendirOptions = Partial<{
bufferSize: number;
}>;
export declare type CreateReadStreamOptions = Partial<{
export type CreateReadStreamOptions = Partial<{
encoding: BufferEncoding;
fd: number;
}>;
export declare type CreateWriteStreamOptions = Partial<{
export type CreateWriteStreamOptions = Partial<{
encoding: BufferEncoding;

@@ -45,7 +45,7 @@ fd: number;

}>;
export declare type MkdirOptions = Partial<{
export type MkdirOptions = Partial<{
recursive: boolean;
mode: number;
}>;
export declare type RmdirOptions = Partial<{
export type RmdirOptions = Partial<{
maxRetries: number;

@@ -55,3 +55,3 @@ recursive: boolean;

}>;
export declare type WriteFileOptions = Partial<{
export type WriteFileOptions = Partial<{
encoding: BufferEncoding;

@@ -61,3 +61,3 @@ mode: number;

}> | BufferEncoding;
export declare type WatchOptions = Partial<{
export type WatchOptions = Partial<{
persistent: boolean;

@@ -67,3 +67,3 @@ recursive: boolean;

}> | BufferEncodingOrBuffer;
export declare type WatchFileOptions = Partial<{
export type WatchFileOptions = Partial<{
bigint: boolean;

@@ -73,20 +73,20 @@ persistent: boolean;

}>;
export declare type ChangeFileOptions = Partial<{
export type ChangeFileOptions = Partial<{
automaticNewlines: boolean;
mode: number;
}>;
export declare type WatchCallback = (eventType: string, filename: string) => void;
export declare type Watcher = {
export type WatchCallback = (eventType: string, filename: string) => void;
export type Watcher = {
on: any;
close: () => void;
};
export declare type WatchFileCallback = (current: Stats, previous: Stats) => void;
export declare type StatWatcher = EventEmitter & {
export type WatchFileCallback = (current: Stats, previous: Stats) => void;
export type StatWatcher = EventEmitter & {
ref?: () => StatWatcher;
unref?: () => StatWatcher;
};
export declare type ExtractHintOptions = {
export type ExtractHintOptions = {
relevantExtensions: Set<string>;
};
export declare type SymlinkType = 'file' | 'dir' | 'junction';
export type SymlinkType = 'file' | 'dir' | 'junction';
export interface StatOptions {

@@ -93,0 +93,0 @@ bigint?: boolean | undefined;

import { FakeFS } from './FakeFS';
import { ProxiedFS } from './ProxiedFS';
import { PortablePath } from './path';
export declare type JailFSOptions = {
export type JailFSOptions = {
baseFs?: FakeFS<PortablePath>;

@@ -6,0 +6,0 @@ };

import { FakeFS } from './FakeFS';
import { ProxiedFS } from './ProxiedFS';
import { Path, PathUtils } from './path';
export declare type LazyFSFactory<P extends Path> = () => FakeFS<P>;
export type LazyFSFactory<P extends Path> = () => FakeFS<P>;
export declare class LazyFS<P extends Path> extends ProxiedFS<P, P> {

@@ -6,0 +6,0 @@ private readonly factory;

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

import { Filename, FSPath, PortablePath } from './path';
export declare type GetMountPointFn = (path: PortablePath, prefixPath: PortablePath) => PortablePath | null;
export type GetMountPointFn = (path: PortablePath, prefixPath: PortablePath) => PortablePath | null;
export interface MountableFS extends FakeFS<PortablePath> {

@@ -17,3 +17,3 @@ hasOpenFileHandles?(): boolean;

}
export declare type MountFSOptions<MountedFS extends MountableFS> = {
export type MountFSOptions<MountedFS extends MountableFS> = {
baseFs?: FakeFS<PortablePath>;

@@ -20,0 +20,0 @@ filter?: RegExp | null;

@@ -14,4 +14,4 @@ /// <reference types="node" />

}
declare type OpenMode = number | string;
declare type Mode = number | string;
type OpenMode = number | string;
type Mode = number | string;
interface FileReadResult<T extends ArrayBufferView> {

@@ -37,3 +37,3 @@ bytesRead: number;

}
declare type WriteArgsBuffer<TBuffer extends Uint8Array> = [
type WriteArgsBuffer<TBuffer extends Uint8Array> = [
buffer: TBuffer,

@@ -44,3 +44,3 @@ offset?: number | null,

];
declare type WriteArgsString = [
type WriteArgsString = [
data: string,

@@ -47,0 +47,0 @@ position?: number | null,

@@ -6,6 +6,6 @@ declare enum PathType {

}
export declare type PortablePath = string & {
export type PortablePath = string & {
__pathType: PathType.File | PathType.Portable;
};
export declare type NativePath = string & {
export type NativePath = string & {
__pathType?: PathType.File | PathType.Native;

@@ -17,6 +17,6 @@ };

};
export declare type Filename = string & {
export type Filename = string & {
__pathType: PathType.File;
};
export declare type Path = PortablePath | NativePath;
export type Path = PortablePath | NativePath;
export declare const Filename: {

@@ -37,3 +37,3 @@ home: Filename;

};
export declare type FSPath<T extends Path> = T | number;
export type FSPath<T extends Path> = T | number;
export declare const npath: PathUtils<NativePath> & ConvertUtils;

@@ -40,0 +40,0 @@ export declare const ppath: PathUtils<PortablePath>;

import { FakeFS, ExtractHintOptions } from './FakeFS';
import { ProxiedFS } from './ProxiedFS';
import { Filename, PortablePath } from './path';
export declare type VirtualFSOptions = {
export type VirtualFSOptions = {
baseFs?: FakeFS<PortablePath>;

@@ -6,0 +6,0 @@ folderName?: Filename;

@@ -17,6 +17,2 @@ "use strict";

class VirtualFS extends ProxiedFS_1.ProxiedFS {
constructor({ baseFs = new NodeFS_1.NodeFS() } = {}) {
super(path_1.ppath);
this.baseFs = baseFs;
}
static makeVirtualPath(base, component, to) {

@@ -53,2 +49,6 @@ if (path_1.ppath.basename(base) !== `__virtual__`)

}
constructor({ baseFs = new NodeFS_1.NodeFS() } = {}) {
super(path_1.ppath);
this.baseFs = baseFs;
}
getExtractHint(hints) {

@@ -55,0 +55,0 @@ return this.baseFs.getExtractHint(hints);

import { NodeFS } from './NodeFS';
import { PortablePath } from './path';
export declare type XFS = NodeFS & {
export type XFS = NodeFS & {
detachTemp(p: PortablePath): void;

@@ -5,0 +5,0 @@ mktempSync(): PortablePath;

{
"name": "@yarnpkg/fslib",
"version": "3.0.0-rc.21",
"version": "3.0.0-rc.22",
"stableVersion": "2.7.0",

@@ -16,3 +16,3 @@ "license": "BSD-2-Clause",

"devDependencies": {
"@yarnpkg/libzip": "^3.0.0-rc.21"
"@yarnpkg/libzip": "^3.0.0-rc.22"
},

@@ -19,0 +19,0 @@ "scripts": {

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