mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
21 lines
426 B
TypeScript
21 lines
426 B
TypeScript
/// <reference types="node" />
|
|
|
|
import xmlEscape = require("xml-escape");
|
|
|
|
const xml = `
|
|
<message>
|
|
<to>Barack Obama</to>
|
|
<from>Joe Biden</from>
|
|
<subject>Cats</subject>
|
|
<content>I freakin' love cats!!&!</content
|
|
</message>
|
|
`;
|
|
|
|
const fullEscaped = xmlEscape(xml); // $ExpectType string
|
|
const preservingApostrophe = xmlEscape(xml, "&"); // $ExpectType string
|
|
|
|
console.info({
|
|
fullEscaped,
|
|
preservingApostrophe
|
|
});
|