Socket
Socket
Sign inDemoInstall

@microsoft/node-core-library

Package Overview
Dependencies
Maintainers
2
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/node-core-library - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

12

CHANGELOG.json

@@ -5,2 +5,14 @@ {

{
"version": "0.6.1",
"tag": "@microsoft/node-core-library_v0.6.1",
"date": "Sat, 17 Feb 2018 02:53:49 GMT",
"comments": {
"patch": [
{
"comment": "Fix an issue for LockFiles where not all filesystem operations were wrapped in a try/catch block."
}
]
}
},
{
"version": "0.6.0",

@@ -7,0 +19,0 @@ "tag": "@microsoft/node-core-library_v0.6.0",

9

CHANGELOG.md
# Change Log - @microsoft/node-core-library
This log was last generated on Fri, 16 Feb 2018 22:05:23 GMT and should not be manually modified.
This log was last generated on Sat, 17 Feb 2018 02:53:49 GMT and should not be manually modified.
## 0.6.1
Sat, 17 Feb 2018 02:53:49 GMT
### Patches
- Fix an issue for LockFiles where not all filesystem operations were wrapped in a try/catch block.
## 0.6.0

@@ -6,0 +13,0 @@ Fri, 16 Feb 2018 22:05:23 GMT

36

lib/LockFile.js

@@ -223,23 +223,23 @@ "use strict";

let dirtyWhenAcquired = false;
if (fsx.existsSync(lockFilePath)) {
dirtyWhenAcquired = true;
// If the lockfile is held by an process with an exclusive lock, then removing it will
// silently fail. OpenSync() below will then fail and we will be unable to create a lock.
// Otherwise, the lockfile is sitting on disk, but nothing is holding it, implying that
// the last process to hold it died.
fsx.unlinkSync(lockFilePath);
}
let fileDescriptor;
try {
// Attempt to open an exclusive lockfile
fileDescriptor = fsx.openSync(lockFilePath, 'wx');
}
catch (error) {
// we tried to delete the lock, but something else is holding it,
// (probably an active process), therefore we are unable to create a lock
return undefined;
}
// Ensure we can hand off the file descriptor to the lockfile
let lockFile;
try {
if (fsx.existsSync(lockFilePath)) {
dirtyWhenAcquired = true;
// If the lockfile is held by an process with an exclusive lock, then removing it will
// silently fail. OpenSync() below will then fail and we will be unable to create a lock.
// Otherwise, the lockfile is sitting on disk, but nothing is holding it, implying that
// the last process to hold it died.
fsx.unlinkSync(lockFilePath);
}
try {
// Attempt to open an exclusive lockfile
fileDescriptor = fsx.openSync(lockFilePath, 'wx');
}
catch (error) {
// we tried to delete the lock, but something else is holding it,
// (probably an active process), therefore we are unable to create a lock
return undefined;
}
// Ensure we can hand off the file descriptor to the lockfile
lockFile = new LockFile(fileDescriptor, lockFilePath, dirtyWhenAcquired);

@@ -246,0 +246,0 @@ fileDescriptor = undefined;

{
"name": "@microsoft/node-core-library",
"version": "0.6.0",
"version": "0.6.1",
"description": "Core libraries that every NodeJS toolchain project should use",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

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