Skip to content

Commit

Permalink
оптимизация для больших объектов (тест по объектам 11МБ)
Browse files Browse the repository at this point in the history
  • Loading branch information
siarheidudko committed Dec 9, 2019
1 parent f06078c commit 9ad3d76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ let Parser = function(_start = '', _separator = '', _end = ''){
} else if(self.LeftBrace < self.RightBrace){
self.clear();
error.push(new Error('Parsing error, clear buffer!'));
} else if(self.StringBufferArray.length > 65536){
let _nbuffer = Buffer.concat(self.StringBufferArray);
self.StringBufferArray = new Array();
self.StringBufferArray.push(_nbuffer);
}
};
if(error.length > 0){
Expand Down
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sergdudko/objectstream",
"version": "1.5.0",
"version": "1.6.0",
"description": "Creates a stream to convert json from string or convert json to drain. The stream is based on the incoming object stream.",
"main": "index.js",
"scripts": {
Expand All @@ -21,9 +21,5 @@
"jsonparser",
"jsonstringify"
],
"homepage": "https://github.com/siarheidudko/objectstream.git#readme",
"dependencies": {
"stream": "0.0.2",
"string_decoder": "^1.3.0"
}
"homepage": "https://github.com/siarheidudko/objectstream.git#readme"
}

0 comments on commit 9ad3d76

Please sign in to comment.