From 53c2f486cc5b95fb8bf884a817c6a2f77ba76d3f Mon Sep 17 00:00:00 2001 From: Louis-Dominique Dubeau Date: Thu, 19 Jan 2017 14:31:14 -0500 Subject: [PATCH] Added the ENTITIES member to SAXParser. The README is clear that the ENTITIES member is accessible to client code and can be modified by client code as needed. See: https://github.com/isaacs/sax-js/blob/v1.2.1/README.md#regarding-doctypes-and-entitys --- sax/index.d.ts | 3 ++- sax/sax-tests.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sax/index.d.ts b/sax/index.d.ts index c17ebd6928..4c556d8aab 100644 --- a/sax/index.d.ts +++ b/sax/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for sax js +// Type definitions for sax-js 1.x // Project: https://github.com/isaacs/sax-js // Definitions by: Asana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -63,6 +63,7 @@ export declare class SAXParser { strict: boolean; opt: SAXOptions; tag: string; + ENTITIES: {[key: string]: string}; // Events onerror(e: Error): void; diff --git a/sax/sax-tests.ts b/sax/sax-tests.ts index 353ead08e0..4d9a90293d 100644 --- a/sax/sax-tests.ts +++ b/sax/sax-tests.ts @@ -13,6 +13,8 @@ import fs = require("fs"); let parser = sax.parser(/*strict=*/true, opts); + parser.ENTITIES["foo"] = "bar"; + parser.onerror = function(e: Error) { };