File tree 1 file changed +2
-3
lines changed
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 8
8
* @typedef {BufferEncoding|{encoding?: null|BufferEncoding, mode: Mode?, flag?: string} } WriteOptions
9
9
*
10
10
* @typedef {string|Uint8Array } Path Path of the file.
11
- * @typedef {typeof import('url').URL } URL WHATWG URL
12
11
* @typedef {Path|URL|Options|VFile } Compatible Things that can be
13
12
* passed to the function.
14
13
*/
21
20
22
21
import fs from 'fs'
23
22
import path from 'path'
24
- import { fileURLToPath } from 'url'
23
+ import { URL , fileURLToPath } from 'url'
25
24
import buffer from 'is-buffer'
26
25
import { VFile } from 'vfile'
27
26
@@ -37,7 +36,7 @@ import {VFile} from 'vfile'
37
36
export function toVFile ( options ) {
38
37
if ( typeof options === 'string' || buffer ( options ) ) {
39
38
options = { path : String ( options ) }
40
- } else if ( options && options . href && options . origin ) {
39
+ } else if ( options instanceof URL ) {
41
40
options = { path : fileURLToPath ( options ) }
42
41
}
43
42
You can’t perform that action at this time.
0 commit comments