-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new wersion: fix space and spec on json
- Loading branch information
1 parent
c09c672
commit 6bc9d4e
Showing
7 changed files
with
23 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ <h1 class="page-title">Source: index.js</h1> | |
* @author Siarhei Dudko <[email protected]> | ||
* @copyright 2019 | ||
* @license MIT | ||
* @version 1.7.5 | ||
* @version 1.7.6 | ||
* @requires stream | ||
* @requires string_decoder | ||
*/ | ||
|
@@ -149,7 +149,11 @@ <h1 class="page-title">Source: index.js</h1> | |
let self = this; | ||
const _startToken = Buffer.from(_start)[0], | ||
_separatorToken = Buffer.from(_separator)[0], | ||
_endToken = Buffer.from(_end)[0]; | ||
_endToken = Buffer.from(_end)[0], | ||
_spaceToken = Buffer.from(' ')[0], | ||
_rToken = Buffer.from('\r')[0], | ||
_nToken = Buffer.from('\n')[0], | ||
_tToken = Buffer.from('\t')[0]; | ||
self.bytesRead = 0; | ||
self.encoding = 'utf8'; | ||
self.StringDecoder = new StringDecoder(self.encoding); | ||
|
@@ -169,8 +173,8 @@ <h1 class="page-title">Source: index.js</h1> | |
} | ||
if(self.LeftBrace !== 0) { | ||
self.StringBufferArray.push(_buffer.slice(s,s+1)); | ||
} else if((_startToken !== _buffer[s]) && (_endToken !== _buffer[s]) && (_separatorToken !== _buffer[s])){ | ||
error.push(new Error('Unexpected token '+_buffer.slice(s,s+1).toString(self.encoding)+' in JSON at position '+s)); | ||
} else if((_startToken !== _buffer[s]) && (_endToken !== _buffer[s]) && (_separatorToken !== _buffer[s]) && (_spaceToken !== _buffer[s]) && (_rToken !== _buffer[s]) && (_nToken !== _buffer[s]) && (_tToken !== _buffer[s])){ | ||
error.push(new Error('Unexpected token '+_buffer.slice(s,s+1).toString(self.encoding)+' in JSON at position '+(self.bytesRead+s))); | ||
} | ||
} | ||
self.transform = new Stream.Transform({ | ||
|
@@ -292,7 +296,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-se | |
<br class="clear"> | ||
|
||
<footer> | ||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Jan 09 2020 12:19:17 GMT+0300 (GMT+03:00) | ||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Wed Jan 15 2020 09:30:06 GMT+0300 (GMT+03:00) | ||
</footer> | ||
|
||
<script> prettyPrint(); </script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* @author Siarhei Dudko <[email protected]> | ||
* @copyright 2019 | ||
* @license MIT | ||
* @version 1.7.5 | ||
* @version 1.7.6 | ||
* @requires stream | ||
* @requires string_decoder | ||
*/ | ||
|
@@ -121,7 +121,11 @@ let Parser = function(_start = '', _separator = '', _end = ''){ | |
let self = this; | ||
const _startToken = Buffer.from(_start)[0], | ||
_separatorToken = Buffer.from(_separator)[0], | ||
_endToken = Buffer.from(_end)[0]; | ||
_endToken = Buffer.from(_end)[0], | ||
_spaceToken = Buffer.from(' ')[0], | ||
_rToken = Buffer.from('\r')[0], | ||
_nToken = Buffer.from('\n')[0], | ||
_tToken = Buffer.from('\t')[0]; | ||
self.bytesRead = 0; | ||
self.encoding = 'utf8'; | ||
self.StringDecoder = new StringDecoder(self.encoding); | ||
|
@@ -141,8 +145,8 @@ let Parser = function(_start = '', _separator = '', _end = ''){ | |
} | ||
if(self.LeftBrace !== 0) { | ||
self.StringBufferArray.push(_buffer.slice(s,s+1)); | ||
} else if((_startToken !== _buffer[s]) && (_endToken !== _buffer[s]) && (_separatorToken !== _buffer[s])){ | ||
error.push(new Error('Unexpected token '+_buffer.slice(s,s+1).toString(self.encoding)+' in JSON at position '+s)); | ||
} else if((_startToken !== _buffer[s]) && (_endToken !== _buffer[s]) && (_separatorToken !== _buffer[s]) && (_spaceToken !== _buffer[s]) && (_rToken !== _buffer[s]) && (_nToken !== _buffer[s]) && (_tToken !== _buffer[s])){ | ||
error.push(new Error('Unexpected token '+_buffer.slice(s,s+1).toString(self.encoding)+' in JSON at position '+(self.bytesRead+s))); | ||
} | ||
} | ||
self.transform = new Stream.Transform({ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters