From 6f02cfde412bb98624e285e771d857601e0f970e Mon Sep 17 00:00:00 2001 From: Fabian van der Veen Date: Tue, 21 Jan 2020 22:33:17 +0100 Subject: [PATCH] sax: SAXParser.tag is of type Tag (#41763) https://github.com/isaacs/sax-js/blob/d65e3bb5049893aaab4aba05198b9cd335b5a1ad/lib/sax.js#L684 --- types/sax/index.d.ts | 3 ++- types/sax/sax-tests.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/sax/index.d.ts b/types/sax/index.d.ts index 1e0c53c381..08d4d81d1b 100644 --- a/types/sax/index.d.ts +++ b/types/sax/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Vincent Siao (Asana, Inc.) // Evert Pot // Daniel Cassidy +// Fabian van der Veen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -63,7 +64,7 @@ export class SAXParser { closed: boolean; strict: boolean; opt: SAXOptions; - tag: string; + tag: Tag; ENTITIES: {[key: string]: string}; // Events diff --git a/types/sax/sax-tests.ts b/types/sax/sax-tests.ts index 27ed1a6506..11ffaeafae 100644 --- a/types/sax/sax-tests.ts +++ b/types/sax/sax-tests.ts @@ -140,7 +140,9 @@ import fs = require("fs"); const attrValue: string = tag.attributes["name"]; }; - parser.onattribute = (attr: { name: string; value: string; }) => {}; + parser.onattribute = (attr: { name: string; value: string; }) => { + const tag: sax.Tag = parser.tag; + }; parser.onend = () => {};