Skip to content

Commit

Permalink
fix: use the latest xmlchars
Browse files Browse the repository at this point in the history
  • Loading branch information
lddubeau committed Oct 1, 2018
1 parent 7d2d527 commit b30a714
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
22 changes: 5 additions & 17 deletions lib/saxes.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
"use strict";

const {
XML_1_0: {
ED5: {
isS, isChar, isNameStartChar, isNameChar,
lists: {
S,
},
},
},
XMLNS_1_0: {
ED3: {
isNCNameStartChar, isNCNameChar,
},
},
} = require("xmlchars");
const { isS, isChar, isNameStartChar, isNameChar, S_LIST } =
require("xmlchars/xml/1.0/ed5");
const { isNCNameStartChar, isNCNameChar } = require("xmlchars/xmlns/1.0/ed3");

const XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
const XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/";
Expand Down Expand Up @@ -119,8 +107,8 @@ const QUOTES = [DQUOTE, SQUOTE];
const TEXT_TERMINATOR = [LESS, AMP];
const DOCTYPE_TERMINATOR = [...QUOTES, OPEN_BRACKET, GREATER];
const DOCTYPE_DTD_TERMINATOR = [...QUOTES, CLOSE_BRACKET];
const XML_DECL_NAME_TERMINATOR = [EQUAL, QUESTION, ...S];
const ATTRIB_VALUE_UNQUOTED_TERMINATOR = [...S, GREATER, AMP, LESS];
const XML_DECL_NAME_TERMINATOR = [EQUAL, QUESTION, ...S_LIST];
const ATTRIB_VALUE_UNQUOTED_TERMINATOR = [...S_LIST, GREATER, AMP, LESS];

function nsMappingCheck(parser, mapping) {
const { xml, xmlns } = mapping;
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
"xml-conformance-suite": "^1.0.0"
},
"dependencies": {
"xmlchars": "^1.2.0"
"xmlchars": "^1.3.1"
}
}

0 comments on commit b30a714

Please sign in to comment.