mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Add TypeScript version to definition header for xmldoc, fix lint failures in tests for xmldoc
This commit is contained in:
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
||||
// Type definitions for xmldoc 1.1.0
|
||||
// Type definitions for xmldoc 1.1
|
||||
// Project: https://www.npmjs.com/package/xmldoc
|
||||
// Definitions by: Xavier Stouder <https://github.com/Xstoudi>, Andrew Sheehan <https://github.com/ajsheehan>
|
||||
// Definitions: https://github.com/DefinitelyTyped/
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped): // TypeScript Version: 2.1
|
||||
|
||||
export class XmlDocument {
|
||||
constructor(xmlString: string);
|
||||
|
||||
@@ -28,12 +28,12 @@ const authorIsProper = bookNode.valueWithPath("author.name@isProper"); // retur
|
||||
//
|
||||
// https://github.com/nfarina/xmldoc#tostringoptions
|
||||
//
|
||||
document.toString({ compressed: true }) // strips indents and linebreaks
|
||||
document.toString({ trimmed: true }) // trims long strings for easier debugging
|
||||
document.toString({ preserveWhitespace: true }) // prevents whitespace being removed from around element values
|
||||
document.toString({ compressed: true }); // strips indents and linebreaks
|
||||
document.toString({ trimmed: true }); // trims long strings for easier debugging
|
||||
document.toString({ preserveWhitespace: true }); // prevents whitespace being removed from around element values
|
||||
|
||||
const xml = "<author><name>looooooong value</name></author>";
|
||||
console.log("My document: \n" + new xmldoc.XmlDocument(xml).toString({ trimmed: true }))
|
||||
console.log("My document: \n" + new xmldoc.XmlDocument(xml).toString({ trimmed: true }));
|
||||
/* Prints:
|
||||
|
||||
My Document:
|
||||
|
||||
Reference in New Issue
Block a user