-
-
Notifications
You must be signed in to change notification settings - Fork 36.7k
fs: return Buffer from mkdtemp when prefix is a Buffer #64397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hamidrezaghavami
wants to merge
16
commits into
nodejs:main
Choose a base branch
from
hamidrezaghavami:fix-fs-mkdtemp-buffer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+56
−13
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5721674
fs: return Buffer from mkdtemp when prefix is a Buffer
hamidrezaghavami 4b03819
test: restore missing mkdtemp async buffer tests
hamidrezaghavami 5f6fca5
doc: update fs.mkdtemp() return types and history
hamidrezaghavami d7f0985
doc: physically wrap long lines in fs.md to fix markdown linter
hamidrezaghavami f7977f3
doc: fix markdown and yaml line lengths in fs.md
hamidrezaghavami 34885d8
doc: update mkdtempSync and fsPromises.mkdtemp docs
hamidrezaghavami 1a8da2a
doc: update disposable mkdtemp return types
hamidrezaghavami ca78ff4
doc: wrap lines in fs.md
hamidrezaghavami a271708
doc: add changes blocks to mkdtempDisposable functions
hamidrezaghavami 728fb8d
doc: update encoding default for mkdtemp
hamidrezaghavami f4664f1
doc: update missing encoding default for fsPromises.mkdtemp
hamidrezaghavami 11d4f55
doc: add changes YAML entries for mkdtemp encoding default
hamidrezaghavami 0b55cab
Update test/parallel/test-fs-mkdtemp-buffer.js
hamidrezaghavami c11bd20
doc: fix YAML changes indentation for mkdtemp encoding default
hamidrezaghavami cccc0fa
doc: simplify version entry format for mkdtemp
hamidrezaghavami 9d77adc
Update doc/api/fs.md
hamidrezaghavami File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| 'use strict'; | ||
| const common = require('../common'); | ||
| const assert = require('assert'); | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
|
|
||
| const tmpdir = require('../common/tmpdir'); | ||
| tmpdir.refresh(); | ||
|
|
||
| const prefixString = path.join(tmpdir.path, 'buffer-'); | ||
| const prefixBuffer = Buffer.from(prefixString); | ||
|
|
||
| // 1. Test Sync API | ||
| const resultSync = fs.mkdtempSync(prefixBuffer); | ||
| assert.strictEqual(Buffer.isBuffer(resultSync), true); | ||
|
|
||
| // 2. Test Callback API | ||
| fs.mkdtemp(prefixBuffer, common.mustSucceed((result) => { | ||
| assert.strictEqual(Buffer.isBuffer(result), true); | ||
| })); | ||
|
|
||
| // 3. Test Promises API | ||
| fs.promises.mkdtemp(prefixBuffer) | ||
| .then(common.mustCall((resultPromise) => { | ||
| assert.strictEqual(Buffer.isBuffer(resultPromise), true); | ||
| })); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.