stream-stringify
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -118,3 +118,4 @@ // Generated by CoffeeScript 1.9.2 | ||
this.first = false; | ||
return this.op + (this.prettyFormat ? "\n" + this.tabCharacter : "") + data; | ||
data = this.op + (this.prettyFormat ? "\n" + this.tabCharacter : "") + data; | ||
return data; | ||
} else { | ||
@@ -146,3 +147,3 @@ return this.sep + (this.prettyFormat ? "\n" + this.tabCharacter : "") + data; | ||
StreamStringify.prototype._writeNestPrefix = function(key) { | ||
StreamStringify.prototype._specifyNestPrefix = function(key) { | ||
if (key != null) { | ||
@@ -153,3 +154,3 @@ if (this.type === "Array") { | ||
} | ||
this.write(this._applySeparator(this._keyPrefix(key))); | ||
this.initialData = this._applySeparator(this._keyPrefix(key)); | ||
} else { | ||
@@ -160,3 +161,3 @@ if (this.type === "Object") { | ||
} | ||
this.writeElement(''); | ||
this.initialData = this._applySeparator(this._formatEntity('')); | ||
} | ||
@@ -167,3 +168,3 @@ return true; | ||
StreamStringify.prototype.startNewObject = function(key) { | ||
if (this._writeNestPrefix(key)) { | ||
if (this._specifyNestPrefix(key)) { | ||
return this._beginNewStream("Object"); | ||
@@ -174,3 +175,3 @@ } | ||
StreamStringify.prototype.startNewArray = function(key) { | ||
if (this._writeNestPrefix(key)) { | ||
if (this._specifyNestPrefix(key)) { | ||
return this._beginNewStream("Array"); | ||
@@ -191,2 +192,3 @@ } | ||
newStream.isNested = true; | ||
newStream.op = this.initialData + newStream.op; | ||
return newStream; | ||
@@ -239,3 +241,3 @@ }; | ||
if (!this.stopped) { | ||
if (this.outputEmpty) { | ||
if (!(!this.outputEmpty && this.first)) { | ||
if (this.first) { | ||
@@ -247,4 +249,4 @@ this.queue(this.op); | ||
this.queue(this.cl); | ||
this.resume(); | ||
} | ||
this.resume(); | ||
} | ||
@@ -251,0 +253,0 @@ this.stopped = true; |
{ | ||
"name": "stream-stringify", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Stringify nested JSON through streams.", | ||
@@ -5,0 +5,0 @@ "main": "lib/stream-stringify.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32486
276