Comparing version 5.1.1 to 5.2.0
@@ -0,8 +1,34 @@ | ||
/** | ||
* This map registers the type of the `data` key of a `VFile`. | ||
* | ||
* This type can be augmented to register custom `data` types. | ||
* | ||
* @example | ||
* declare module 'vfile' { | ||
* interface VFileDataRegistry { | ||
* // `file.data.name` is typed as `string` | ||
* name: string | ||
* } | ||
* } | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-interface | ||
export interface VFileDataMap {} | ||
/** | ||
* Place to store custom information. | ||
* | ||
* Known attributes can be added to @see {@link VFileDataMap} | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
export type VFileData = Record<string, unknown> & Partial<VFileDataMap> | ||
export type { | ||
BufferEncoding, | ||
VFileValue, | ||
VFileOptions, | ||
VFileCompatible, | ||
VFileReporterSettings, | ||
VFileReporter | ||
} from './lib/index.js' | ||
export {VFile} from './lib/index.js' | ||
export type BufferEncoding = import('./lib/index.js').BufferEncoding | ||
export type VFileValue = import('./lib/index.js').VFileValue | ||
export type VFileOptions = import('./lib/index.js').VFileOptions | ||
export type VFileCompatible = import('./lib/index.js').VFileCompatible | ||
export type VFileReporterSettings = | ||
import('./lib/index.js').VFileReporterSettings | ||
export type VFileReporter = import('./lib/index.js').VFileReporter |
10
index.js
@@ -1,11 +0,1 @@ | ||
/** | ||
* @typedef {import('./lib/index.js').BufferEncoding} BufferEncoding | ||
* @typedef {import('./lib/index.js').VFileValue} VFileValue | ||
* @typedef {import('./lib/index.js').VFileOptions} VFileOptions | ||
* @typedef {import('./lib/index.js').VFileCompatible} VFileCompatible | ||
* | ||
* @typedef {import('./lib/index.js').VFileReporterSettings} VFileReporterSettings | ||
* @typedef {import('./lib/index.js').VFileReporter} VFileReporter | ||
*/ | ||
export {VFile} from './lib/index.js' |
@@ -23,7 +23,5 @@ export class VFile { | ||
* gives a little more privacy. | ||
* @type {Object.<string, unknown>} | ||
* @type {VFileData} | ||
*/ | ||
data: { | ||
[x: string]: unknown | ||
} | ||
data: VFileData | ||
/** | ||
@@ -189,2 +187,3 @@ * List of messages associated with the file. | ||
export type URL = import('./minurl.shared.js').URL | ||
export type VFileData = import('..').VFileData | ||
/** | ||
@@ -230,7 +229,3 @@ * Encodings supported by the buffer class. | ||
dirname?: string | undefined | ||
data?: | ||
| { | ||
[x: string]: unknown | ||
} | ||
| undefined | ||
data?: import('..').VFileData | undefined | ||
} | ||
@@ -237,0 +232,0 @@ /** |
@@ -6,2 +6,3 @@ /** | ||
* @typedef {import('./minurl.shared.js').URL} URL | ||
* @typedef {import('..').VFileData} VFileData | ||
* | ||
@@ -34,3 +35,3 @@ * @typedef {'ascii'|'utf8'|'utf-8'|'utf16le'|'ucs2'|'ucs-2'|'base64'|'base64url'|'latin1'|'binary'|'hex'} BufferEncoding | ||
* @property {string} [dirname] | ||
* @property {Object.<string, unknown>} [data] | ||
* @property {VFileData} [data] | ||
* | ||
@@ -93,3 +94,3 @@ * @typedef {{[key: string]: unknown} & VFileCoreOptions} VFileOptions | ||
* gives a little more privacy. | ||
* @type {Object.<string, unknown>} | ||
* @type {VFileData} | ||
*/ | ||
@@ -96,0 +97,0 @@ this.data = {} |
{ | ||
"name": "vfile", | ||
"version": "5.1.1", | ||
"version": "5.2.0", | ||
"description": "Virtual file format for text processing", | ||
@@ -69,7 +69,7 @@ "license": "MIT", | ||
"typescript": "^4.0.0", | ||
"xo": "^0.45.0" | ||
"xo": "^0.46.0" | ||
}, | ||
"scripts": { | ||
"prepack": "npm run build && npm run format", | ||
"build": "rimraf \"{lib/**,}*.d.ts\" && tsc && type-coverage", | ||
"build": "rimraf \"lib/**/*.d.ts\" \"test.d.ts\" && tsc && tsc --noEmit index.d.ts && type-coverage", | ||
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", | ||
@@ -91,4 +91,3 @@ "test-api": "node test.js", | ||
"rules": { | ||
"unicorn/prefer-node-protocol": "off", | ||
"#unicorn/no-array-for-each": "off" | ||
"unicorn/prefer-node-protocol": "off" | ||
} | ||
@@ -95,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
1160
53353