+23
-12
@@ -37,12 +37,22 @@ /// <reference types="node" /> | ||
| ): VFile | ||
| export const read: { | ||
| (description: Compatible, options: ReadOptions, callback: Callback): void | ||
| (description: Compatible, callback: Callback): void | ||
| (description: Compatible, options?: ReadOptions): Promise<VFile> | ||
| } | ||
| export const write: { | ||
| (description: Compatible, options: WriteOptions, callback: Callback): void | ||
| (description: Compatible, callback: Callback): void | ||
| (description: Compatible, options?: WriteOptions): Promise<VFile> | ||
| } | ||
| export function read( | ||
| description: Compatible, | ||
| options: ReadOptions, | ||
| callback: Callback | ||
| ): void | ||
| export function read(description: Compatible, callback: Callback): void | ||
| export function read( | ||
| description: Compatible, | ||
| options?: ReadOptions | ||
| ): Promise<VFile> | ||
| export function write( | ||
| description: Compatible, | ||
| options: WriteOptions, | ||
| callback: Callback | ||
| ): void | ||
| export function write(description: Compatible, callback: Callback): void | ||
| export function write( | ||
| description: Compatible, | ||
| options?: WriteOptions | ||
| ): Promise<VFile> | ||
| export type Value = import('vfile').VFileValue | ||
@@ -67,4 +77,5 @@ export type Options = import('vfile').VFileOptions | ||
| * Path of the file. | ||
| * Note: `Value` is used here because it’s a smarter `Buffer` | ||
| */ | ||
| export type Path = string | Uint8Array | ||
| export type Path = URL | Value | ||
| /** | ||
@@ -74,3 +85,3 @@ * Things that can be | ||
| */ | ||
| export type Compatible = Path | URL | Options | VFile | ||
| export type Compatible = Path | Options | VFile | ||
| export type Callback = ( | ||
@@ -77,0 +88,0 @@ error: NodeJS.ErrnoException | null, |
+3
-2
@@ -10,4 +10,5 @@ /** | ||
| * | ||
| * @typedef {string|Uint8Array} Path Path of the file. | ||
| * @typedef {Path|URL|Options|VFile} Compatible Things that can be | ||
| * @typedef {URL|Value} Path Path of the file. | ||
| * Note: `Value` is used here because it’s a smarter `Buffer` | ||
| * @typedef {Path|Options|VFile} Compatible Things that can be | ||
| * passed to the function. | ||
@@ -14,0 +15,0 @@ */ |
+2
-2
| { | ||
| "name": "to-vfile", | ||
| "version": "7.2.2", | ||
| "version": "7.2.3", | ||
| "description": "vfile utility to create a vfile from a filepath", | ||
@@ -51,3 +51,3 @@ "license": "MIT", | ||
| "typescript": "^4.0.0", | ||
| "xo": "^0.44.0" | ||
| "xo": "^0.47.0" | ||
| }, | ||
@@ -54,0 +54,0 @@ "scripts": { |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
16465
1.2%305
4.1%