fast-xml-parser 4.2.4 → 4.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/package.json +1 -1
- package/src/xmlparser/DocTypeReader.js +7 -10
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const util = require('../util');
|
|
2
|
+
|
|
1
3
|
//TODO: handle comments
|
|
2
4
|
function readDocType(xmlData, i){
|
|
3
5
|
|
|
@@ -140,16 +142,11 @@ function isNotation(xmlData, i){
|
|
|
140
142
|
return false
|
|
141
143
|
}
|
|
142
144
|
|
|
143
|
-
//an entity name should not contains special characters that may be used in regex
|
|
144
|
-
//Eg !?\\\/[]$%{}^&*()<>
|
|
145
|
-
const specialChar = "!?\\\/[]$%{}^&*()<>|+";
|
|
146
|
-
|
|
147
145
|
function validateEntityName(name){
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
return name;
|
|
146
|
+
if (util.isName(name))
|
|
147
|
+
return name;
|
|
148
|
+
else
|
|
149
|
+
throw new Error(`Invalid entity name ${name}`);
|
|
153
150
|
}
|
|
154
151
|
|
|
155
|
-
module.exports = readDocType;
|
|
152
|
+
module.exports = readDocType;
|