Socket
Socket
Sign inDemoInstall

@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.50 to 3.0.0-rc.51

3

lib/algorithms/opendir.js

@@ -58,3 +58,4 @@ "use strict";

return null;
return Object.assign(fakeFs.statSync(fakeFs.pathUtils.join(path, filename)), {
const entryPath = fakeFs.pathUtils.join(path, filename);
return Object.assign(fakeFs.statSync(entryPath), {
name: filename,

@@ -61,0 +62,0 @@ path: undefined,

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

};
export type Dirent<T extends Path> = Exclude<NodeDirent, 'name'> & {
export type Dirent<T extends Path> = Omit<NodeDirent, 'name' | 'path'> & {
name: Filename;
path: T;
};
export type DirentNoPath = Exclude<NodeDirent, 'name'> & {
export type DirentNoPath = Omit<NodeDirent, 'name' | 'path'> & {
name: Filename;

@@ -25,0 +25,0 @@ };

@@ -39,3 +39,18 @@ "use strict";

}).then(dir => {
return Object.defineProperty(dir, `path`, { value: p, configurable: true, writable: true });
// @ts-expect-error
//
// We need a way to tell TS that the values returned by the `read`
// methods are compatible with `Dir`, especially the `name` field.
//
// We also can't use `Object.assign` to set the because the `path`
// field to a Filename, because the property isn't writable, so
// we need to use defineProperty instead.
//
const dirWithFixedPath = dir;
Object.defineProperty(dirWithFixedPath, `path`, {
value: p,
configurable: true,
writable: true,
});
return dirWithFixedPath;
});

@@ -47,3 +62,18 @@ }

: this.realFs.opendirSync(path_1.npath.fromPortablePath(p));
return Object.defineProperty(dir, `path`, { value: p, configurable: true, writable: true });
// @ts-expect-error
//
// We need a way to tell TS that the values returned by the `read`
// methods are compatible with `Dir`, especially the `name` field.
//
// We also can't use `Object.assign` to set the because the `path`
// field to a Filename, because the property isn't writable, so
// we need to use defineProperty instead.
//
const dirWithFixedPath = dir;
Object.defineProperty(dirWithFixedPath, `path`, {
value: p,
configurable: true,
writable: true,
});
return dirWithFixedPath;
}

@@ -50,0 +80,0 @@ async readPromise(fd, buffer, offset = 0, length = 0, position = -1) {

{
"name": "@yarnpkg/fslib",
"version": "3.0.0-rc.50",
"version": "3.0.0-rc.51",
"stableVersion": "2.10.3",

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

"devDependencies": {
"@yarnpkg/libzip": "^3.0.0-rc.50"
"@yarnpkg/libzip": "^3.0.0-rc.51"
},

@@ -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