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.1 to 3.0.2

20

lib/algorithms/copyPromise.js

@@ -60,7 +60,5 @@ "use strict";

break;
default:
{
throw new Error(`Unsupported file type (${sourceStat.mode})`);
}
break;
default: {
throw new Error(`Unsupported file type (${sourceStat.mode})`);
}
}

@@ -134,3 +132,7 @@ // We aren't allowed to modify the destination if we work with the index,

const sourceHash = await sourceFs.checksumFilePromise(source, { algorithm: `sha1` });
const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${sourceHash}.dat`);
const defaultMode = 0o644;
const sourceMode = sourceStat.mode & 0o777;
// add mode to the index file name if it's not the default b/c different packages could have the file with same content, but different modes
const indexFileName = `${sourceHash}${sourceMode !== defaultMode ? sourceMode.toString(8) : ``}`;
const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${indexFileName}.dat`);
let AtomicBehavior;

@@ -217,4 +219,8 @@ (function (AtomicBehavior) {

postlayout.push(async () => {
if (!indexStat)
if (!indexStat) {
await destinationFs.lutimesPromise(indexPath, defaultTime, defaultTime);
if (sourceMode !== defaultMode) {
await destinationFs.chmodPromise(indexPath, sourceMode);
}
}
if (tempPath && !tempPathCleaned) {

@@ -221,0 +227,0 @@ await destinationFs.unlinkPromise(tempPath);

/// <reference types="node" />
/// <reference types="node" />
import { URL } from 'url';
import { FakeFS } from './FakeFS';

@@ -5,0 +3,0 @@ import { ProxiedFS } from './ProxiedFS';

@@ -30,3 +30,3 @@ "use strict";

return path;
if (path instanceof url_1.URL)
if (path instanceof URL)
return (0, url_1.fileURLToPath)(path);

@@ -33,0 +33,0 @@ if (Buffer.isBuffer(path)) {

{
"name": "@yarnpkg/fslib",
"version": "3.0.1",
"version": "3.0.2",
"license": "BSD-2-Clause",

@@ -15,3 +15,3 @@ "main": "./lib/index.js",

"devDependencies": {
"@yarnpkg/libzip": "^3.0.0"
"@yarnpkg/libzip": "^3.0.1"
},

@@ -18,0 +18,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