@yarnpkg/fslib
Advanced tools
Comparing version 3.0.0-rc.27 to 3.0.0-rc.28
@@ -21,2 +21,3 @@ /// <reference types="node" /> | ||
maxOpenFiles?: number; | ||
typeCheck?: number | null; | ||
useCache?: boolean; | ||
@@ -53,6 +54,7 @@ /** | ||
private readonly maxOpenFiles; | ||
private readonly typeCheck; | ||
private isMount; | ||
private notMount; | ||
private realPaths; | ||
constructor({ baseFs, filter, magicByte, maxOpenFiles, useCache, maxAge, getMountPoint, factoryPromise, factorySync }: MountFSOptions<MountedFS>); | ||
constructor({ baseFs, filter, magicByte, maxOpenFiles, useCache, maxAge, typeCheck, getMountPoint, factoryPromise, factorySync }: MountFSOptions<MountedFS>); | ||
getExtractHint(hints: ExtractHintOptions): boolean; | ||
@@ -59,0 +61,0 @@ getRealPath(): PortablePath; |
@@ -20,3 +20,3 @@ "use strict"; | ||
class MountFS extends FakeFS_1.BasePortableFakeFS { | ||
constructor({ baseFs = new NodeFS_1.NodeFS(), filter = null, magicByte = 0x2a, maxOpenFiles = Infinity, useCache = true, maxAge = 5000, getMountPoint, factoryPromise, factorySync }) { | ||
constructor({ baseFs = new NodeFS_1.NodeFS(), filter = null, magicByte = 0x2a, maxOpenFiles = Infinity, useCache = true, maxAge = 5000, typeCheck = fs_1.constants.S_IFREG, getMountPoint, factoryPromise, factorySync }) { | ||
if (Math.floor(magicByte) !== magicByte || !(magicByte > 1 && magicByte <= 127)) | ||
@@ -40,2 +40,3 @@ throw new Error(`The magic byte must be set to a round value between 1 and 127 included`); | ||
this.maxOpenFiles = maxOpenFiles; | ||
this.typeCheck = typeCheck; | ||
} | ||
@@ -746,3 +747,3 @@ getExtractHint(hints) { | ||
try { | ||
if (!this.baseFs.lstatSync(filePath).isFile()) { | ||
if (this.typeCheck !== null && (this.baseFs.lstatSync(filePath).mode & fs_1.constants.S_IFMT) !== this.typeCheck) { | ||
this.notMount.add(filePath); | ||
@@ -749,0 +750,0 @@ continue; |
@@ -15,2 +15,3 @@ declare enum PathType { | ||
dot: PortablePath; | ||
parent: PortablePath; | ||
}; | ||
@@ -17,0 +18,0 @@ export type Filename = string & { |
@@ -15,2 +15,3 @@ "use strict"; | ||
dot: `.`, | ||
parent: `..`, | ||
}; | ||
@@ -17,0 +18,0 @@ exports.Filename = { |
{ | ||
"name": "@yarnpkg/fslib", | ||
"version": "3.0.0-rc.27", | ||
"version": "3.0.0-rc.28", | ||
"stableVersion": "2.8.0", | ||
@@ -16,3 +16,3 @@ "license": "BSD-2-Clause", | ||
"devDependencies": { | ||
"@yarnpkg/libzip": "^3.0.0-rc.27" | ||
"@yarnpkg/libzip": "^3.0.0-rc.28" | ||
}, | ||
@@ -19,0 +19,0 @@ "scripts": { |
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
220679
5656