15 lines
663 B
TypeScript
15 lines
663 B
TypeScript
import { Readable } from 'node:stream';
|
|
/**
|
|
* Verify the passed in xml is valid. Requires xmllib be installed
|
|
*
|
|
* Security: This function always pipes XML content via stdin to prevent
|
|
* command injection vulnerabilities. Never pass user-controlled strings
|
|
* as file path arguments to xmllint.
|
|
*
|
|
* @param xml what you want validated (string or Readable stream)
|
|
* @return {Promise<void>} resolves on valid. Rejects with [error, stderr] when
|
|
* the xml is invalid, or with [error] alone when validation could not run
|
|
* (xmllint missing or not executable, or the schema not found).
|
|
*/
|
|
export declare function xmlLint(xml: string | Readable): Promise<void>;
|