Comparing version 5.2.0 to 5.2.1
@@ -0,2 +1,23 @@ | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error | ||
// @ts-ignore It’s important to preserve this ignore statement. This makes sure | ||
// it works both with and without node types. | ||
import {Buffer} from 'buffer' | ||
/** | ||
* This is the same as `Buffer` if node types are included, `never` otherwise. | ||
*/ | ||
type MaybeBuffer = any extends Buffer ? never : Buffer | ||
/** | ||
* Contents of the file. | ||
* Can either be text, or a Buffer like structure. | ||
* This does not directly use type `Buffer`, because it can also be used in a | ||
* browser context. | ||
* Instead this leverages `Uint8Array` which is the base type for `Buffer`, | ||
* and a native JavaScript construct. | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
export type VFileValue = string | MaybeBuffer | ||
/** | ||
* This map registers the type of the `data` key of a `VFile`. | ||
@@ -27,3 +48,2 @@ * | ||
BufferEncoding, | ||
VFileValue, | ||
VFileOptions, | ||
@@ -30,0 +50,0 @@ VFileCompatible, |
@@ -187,2 +187,3 @@ export class VFile { | ||
export type VFileData = import('..').VFileData | ||
export type VFileValue = import('..').VFileValue | ||
/** | ||
@@ -207,11 +208,2 @@ * Encodings supported by the buffer class. | ||
/** | ||
* Contents of the file. | ||
* Can either be text, or a Buffer like structure. | ||
* This does not directly use type `Buffer`, because it can also be used in a | ||
* browser context. | ||
* Instead this leverages `Uint8Array` which is the base type for `Buffer`, | ||
* and a native JavaScript construct. | ||
*/ | ||
export type VFileValue = string | Uint8Array | ||
/** | ||
* Things that can be passed to the constructor. | ||
@@ -221,3 +213,3 @@ */ | ||
export type VFileCoreOptions = { | ||
value?: VFileValue | undefined | ||
value?: import('..').VFileValue | undefined | ||
cwd?: string | undefined | ||
@@ -224,0 +216,0 @@ history?: string[] | undefined |
@@ -7,2 +7,3 @@ /** | ||
* @typedef {import('..').VFileData} VFileData | ||
* @typedef {import('..').VFileValue} VFileValue | ||
* | ||
@@ -15,9 +16,2 @@ * @typedef {'ascii'|'utf8'|'utf-8'|'utf16le'|'ucs2'|'ucs-2'|'base64'|'base64url'|'latin1'|'binary'|'hex'} BufferEncoding | ||
* | ||
* @typedef {string|Uint8Array} VFileValue | ||
* Contents of the file. | ||
* Can either be text, or a Buffer like structure. | ||
* This does not directly use type `Buffer`, because it can also be used in a | ||
* browser context. | ||
* Instead this leverages `Uint8Array` which is the base type for `Buffer`, | ||
* and a native JavaScript construct. | ||
* | ||
@@ -291,3 +285,2 @@ * @typedef {VFileValue|VFileOptions|VFile|URL} VFileCompatible | ||
toString(encoding) { | ||
// @ts-expect-error string’s don’t accept the parameter, but buffers do. | ||
return (this.value || '').toString(encoding) | ||
@@ -294,0 +287,0 @@ } |
@@ -1,3 +0,1 @@ | ||
/// <reference types="node" /> | ||
export {path} | ||
import path from 'path' | ||
export {default as path} from 'path' |
@@ -1,3 +0,1 @@ | ||
import path from 'path' | ||
export {path} | ||
export {default as path} from 'path' |
@@ -1,1 +0,1 @@ | ||
export const proc: NodeJS.Process | ||
export {default as proc} from 'process' |
@@ -1,3 +0,1 @@ | ||
import process from 'process' | ||
export const proc = process | ||
export {default as proc} from 'process' |
@@ -6,3 +6,2 @@ /// <reference lib="dom" /> | ||
export function urlToPath(path: string | URL): string | ||
export {isUrl} | ||
import {isUrl} from './minurl.shared.js' | ||
export {isUrl} from './minurl.shared.js' |
@@ -5,4 +5,2 @@ /// <reference lib="dom" /> | ||
export {isUrl} | ||
// See: <https://github.com/nodejs/node/blob/fcf8ba4/lib/internal/url.js> | ||
@@ -72,1 +70,3 @@ | ||
} | ||
export {isUrl} from './minurl.shared.js' |
{ | ||
"name": "vfile", | ||
"version": "5.2.0", | ||
"version": "5.2.1", | ||
"description": "Virtual file format for text processing", | ||
@@ -69,3 +69,3 @@ "license": "MIT", | ||
"typescript": "^4.0.0", | ||
"xo": "^0.46.0" | ||
"xo": "^0.47.0" | ||
}, | ||
@@ -91,2 +91,3 @@ "scripts": { | ||
"rules": { | ||
"unicorn/prefer-code-point": "off", | ||
"unicorn/prefer-node-protocol": "off" | ||
@@ -93,0 +94,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53506
1157