sax 1.1.4 → 1.1.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/lib/sax.js +10 -2
- package/package.json +4 -5
package/lib/sax.js
CHANGED
|
@@ -968,6 +968,14 @@
|
|
|
968
968
|
}
|
|
969
969
|
}
|
|
970
970
|
|
|
971
|
+
function charAt (chunk, i) {
|
|
972
|
+
var result = ''
|
|
973
|
+
if (i < chunk.length) {
|
|
974
|
+
result = chunk.charAt(i)
|
|
975
|
+
}
|
|
976
|
+
return result
|
|
977
|
+
}
|
|
978
|
+
|
|
971
979
|
function write (chunk) {
|
|
972
980
|
var parser = this
|
|
973
981
|
if (this.error) {
|
|
@@ -983,7 +991,7 @@
|
|
|
983
991
|
var i = 0
|
|
984
992
|
var c = ''
|
|
985
993
|
while (true) {
|
|
986
|
-
c =
|
|
994
|
+
c = charAt(chunk, i++)
|
|
987
995
|
parser.c = c
|
|
988
996
|
if (!c) {
|
|
989
997
|
break
|
|
@@ -1014,7 +1022,7 @@
|
|
|
1014
1022
|
if (parser.sawRoot && !parser.closedRoot) {
|
|
1015
1023
|
var starti = i - 1
|
|
1016
1024
|
while (c && c !== '<' && c !== '&') {
|
|
1017
|
-
c =
|
|
1025
|
+
c = charAt(chunk, i++)
|
|
1018
1026
|
if (c && parser.trackPosition) {
|
|
1019
1027
|
parser.position++
|
|
1020
1028
|
if (c === '\n') {
|
package/package.json
CHANGED
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
"name": "sax",
|
|
3
3
|
"description": "An evented streaming XML parser in JavaScript",
|
|
4
4
|
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.5",
|
|
6
6
|
"main": "lib/sax.js",
|
|
7
7
|
"license": "ISC",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"test": "tap test/*.js",
|
|
10
|
-
"posttest": "
|
|
11
|
-
"lint": "standard -F test/*.js lib/*.js"
|
|
9
|
+
"test": "tap test/*.js --cov",
|
|
10
|
+
"posttest": "standard -F test/*.js lib/*.js"
|
|
12
11
|
},
|
|
13
12
|
"repository": "git://github.com/isaacs/sax-js.git",
|
|
14
13
|
"files": [
|
|
@@ -19,6 +18,6 @@
|
|
|
19
18
|
],
|
|
20
19
|
"devDependencies": {
|
|
21
20
|
"standard": "^5.3.1",
|
|
22
|
-
"tap": "^2.
|
|
21
|
+
"tap": "^5.2.0"
|
|
23
22
|
}
|
|
24
23
|
}
|