@muze-nl/od-jsontag 0.2.8 → 0.2.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muze-nl/od-jsontag",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "On Demand JSONTag: parse/serialize large datastructures on demand, useful for sharing data between threads",
5
5
  "type": "module",
6
6
  "author": "Auke van Slooten <auke@muze.nl>",
package/src/serialize.mjs CHANGED
@@ -167,7 +167,11 @@ export default function serialize(value, options={}) {
167
167
  let skipCount = 0
168
168
  let result = []
169
169
  while(currentSource<resultArray.length) {
170
- if (resultArray[currentSource][isChanged] || !resultArray[currentSource][isProxy]) {
170
+ if (!resultArray[currentSource]) {
171
+ //FIXME: should not happen, this means that there is no complete
172
+ //od-jsontag file, only patches?
173
+ skipCount++
174
+ } else if (resultArray[currentSource][isChanged] || !resultArray[currentSource][isProxy]) {
171
175
  if (skipCount) {
172
176
  result[currentResult] = encoder.encode('+'+skipCount)
173
177
  skipCount = 0