Add TypeScript version to definition header for xmldoc, fix lint failures in tests for xmldoc

This commit is contained in:
Andrew Sheehan
2017-05-23 10:41:37 -05:00
parent 6ce5f0c003
commit 84241ecf3d
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -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);
+4 -4
View File
@@ -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: