From 1f6daf5b9df054952a47df01780039bd5da8f024 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 12:28:19 -0700 Subject: [PATCH] deps: write-file-atomic@4.0.2 --- node_modules/write-file-atomic/lib/index.js | 13 ++++++++--- node_modules/write-file-atomic/package.json | 24 +++++++++++---------- package-lock.json | 7 +++--- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/node_modules/write-file-atomic/lib/index.js b/node_modules/write-file-atomic/lib/index.js index 118666d2ce6d8..9d79d797a553f 100644 --- a/node_modules/write-file-atomic/lib/index.js +++ b/node_modules/write-file-atomic/lib/index.js @@ -39,7 +39,9 @@ function cleanupOnExit (tmpfile) { return () => { try { fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) - } catch (_) {} + } catch { + // ignore errors + } } } @@ -156,7 +158,7 @@ async function writeFileAsync (filename, data, options = {}) { } } -function writeFile (filename, data, options, callback) { +async function writeFile (filename, data, options, callback) { if (options instanceof Function) { callback = options options = {} @@ -164,7 +166,12 @@ function writeFile (filename, data, options, callback) { const promise = writeFileAsync(filename, data, options) if (callback) { - promise.then(callback, callback) + try { + const result = await promise + return callback(result) + } catch (err) { + return callback(err) + } } return promise diff --git a/node_modules/write-file-atomic/package.json b/node_modules/write-file-atomic/package.json index 7219f90b97be0..86e2a0fbadfeb 100644 --- a/node_modules/write-file-atomic/package.json +++ b/node_modules/write-file-atomic/package.json @@ -1,23 +1,23 @@ { "name": "write-file-atomic", - "version": "4.0.1", + "version": "4.0.2", "description": "Write files in an atomic fashion w/configurable ownership", "main": "./lib/index.js", "scripts": { "test": "tap", "posttest": "npm run lint", - "lint": "eslint '**/*.js'", - "postlint": "npm-template-check", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "lintfix": "npm run lint -- --fix", "snap": "tap", - "template-copy": "npm-template-copy --force" + "template-oss-apply": "template-oss-apply --force" }, "repository": { "type": "git", - "url": "git://github.com/npm/write-file-atomic.git" + "url": "https://github.com/npm/write-file-atomic.git" }, "keywords": [ "writeFile", @@ -34,20 +34,22 @@ "signal-exit": "^3.0.7" }, "devDependencies": { - "@npmcli/template-oss": "^2.7.1", + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.5.0", "mkdirp": "^1.0.4", "rimraf": "^3.0.2", - "tap": "^15.1.6" + "tap": "^16.0.1" }, "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "windowsCI": false, - "version": "2.7.1" + "version": "3.5.0" } } diff --git a/package-lock.json b/package-lock.json index 66e80b12d628c..299e955141fe6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9824,15 +9824,16 @@ "license": "ISC" }, "node_modules/write-file-atomic": { - "version": "4.0.1", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "inBundle": true, - "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/ws": {