diff options
Diffstat (limited to 'deps/npm/node_modules/write-file-atomic')
-rw-r--r-- | deps/npm/node_modules/write-file-atomic/LICENSE.md (renamed from deps/npm/node_modules/write-file-atomic/LICENSE) | 1 | ||||
-rw-r--r-- | deps/npm/node_modules/write-file-atomic/lib/index.js (renamed from deps/npm/node_modules/write-file-atomic/index.js) | 19 | ||||
-rw-r--r-- | deps/npm/node_modules/write-file-atomic/package.json | 36 |
3 files changed, 35 insertions, 21 deletions
diff --git a/deps/npm/node_modules/write-file-atomic/LICENSE b/deps/npm/node_modules/write-file-atomic/LICENSE.md index 95e65a7706e..af4588069db 100644 --- a/deps/npm/node_modules/write-file-atomic/LICENSE +++ b/deps/npm/node_modules/write-file-atomic/LICENSE.md @@ -3,4 +3,3 @@ Copyright (c) 2015, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - diff --git a/deps/npm/node_modules/write-file-atomic/index.js b/deps/npm/node_modules/write-file-atomic/lib/index.js index df5b72a14f7..9a7d183aecb 100644 --- a/deps/npm/node_modules/write-file-atomic/index.js +++ b/deps/npm/node_modules/write-file-atomic/lib/index.js @@ -48,10 +48,14 @@ function cleanupOnExit (tmpfile) { function serializeActiveFile (absoluteName) { return new Promise(resolve => { // make a queue if it doesn't already exist - if (!activeFiles[absoluteName]) activeFiles[absoluteName] = [] + if (!activeFiles[absoluteName]) { + activeFiles[absoluteName] = [] + } activeFiles[absoluteName].push(resolve) // add this job to the queue - if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one + if (activeFiles[absoluteName].length === 1) { + resolve() + } // kick off the first one }) } @@ -151,7 +155,9 @@ async function writeFileAsync (filename, data, options = {}) { activeFiles[absoluteName].shift() // remove the element added by serializeSameFile if (activeFiles[absoluteName].length > 0) { activeFiles[absoluteName][0]() // start next job if one is pending - } else delete activeFiles[absoluteName] + } else { + delete activeFiles[absoluteName] + } } } @@ -170,8 +176,11 @@ function writeFile (filename, data, options, callback) { } function writeFileSync (filename, data, options) { - if (typeof options === 'string') options = { encoding: options } - else if (!options) options = {} + if (typeof options === 'string') { + options = { encoding: options } + } else if (!options) { + options = {} + } try { filename = fs.realpathSync(filename) } catch (ex) { diff --git a/deps/npm/node_modules/write-file-atomic/package.json b/deps/npm/node_modules/write-file-atomic/package.json index 98a29a05345..031eccdba87 100644 --- a/deps/npm/node_modules/write-file-atomic/package.json +++ b/deps/npm/node_modules/write-file-atomic/package.json @@ -1,16 +1,18 @@ { "name": "write-file-atomic", - "version": "3.0.3", + "version": "4.0.0", "description": "Write files in an atomic fashion w/configurable ownership", - "main": "index.js", + "main": "./lib/index.js", "scripts": { "test": "tap", "posttest": "npm run lint", - "lint": "standard", - "postlint": "rimraf chowncopy good nochmod nochown nofsync nofsyncopt noopen norename \"norename nounlink\" nowrite", + "lint": "eslint '**/*.js'", + "postlint": "npm-template-check", "preversion": "npm test", "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" + "prepublishOnly": "git push origin --follow-tags", + "lintfix": "npm run lint -- --fix", + "snap": "tap" }, "repository": { "type": "git", @@ -20,7 +22,7 @@ "writeFile", "atomic" ], - "author": "Rebecca Turner <me@re-becca.org> (http://re-becca.org)", + "author": "GitHub Inc.", "license": "ISC", "bugs": { "url": "https://github.com/npm/write-file-atomic/issues" @@ -30,19 +32,23 @@ "imurmurhash": "^0.1.4", "is-typedarray": "^1.0.0", "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" + "typedarray-to-buffer": "^4.0.0" }, "devDependencies": { - "mkdirp": "^0.5.1", - "require-inject": "^1.4.4", - "rimraf": "^2.6.3", - "standard": "^14.3.1", - "tap": "^14.10.6" + "@npmcli/template-oss": "^2.5.1", + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2", + "tap": "^15.1.6" }, "files": [ - "index.js" + "bin", + "lib" ], - "tap": { - "100": true + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16" + }, + "templateOSS": { + "windowsCI": false, + "version": "2.5.1" } } |