@muze-nl/od-jsontag 0.2.4 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muze-nl/od-jsontag",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
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>",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "repository": {
21
21
  "type": "git",
22
- "url": "https://github.com/muze-nl/od-jsontag.git"
22
+ "url": "git+https://github.com/muze-nl/od-jsontag.git"
23
23
  },
24
24
  "engines": {
25
25
  "node": ">=20.0.0"
package/src/serialize.mjs CHANGED
@@ -157,10 +157,7 @@ export default function serialize(value, options={}) {
157
157
  let currentSource = 0
158
158
  let currentResult = 0
159
159
  let skipCount = 0
160
- let result = resultArray
161
- if (options.changes) {
162
- result = []
163
- }
160
+ let result = []
164
161
  while(currentSource<resultArray.length) {
165
162
  if (resultArray[currentSource][isChanged] || !resultArray[currentSource][isProxy]) {
166
163
  if (skipCount) {
@@ -177,7 +174,7 @@ export default function serialize(value, options={}) {
177
174
  }
178
175
  currentResult++
179
176
  } else if (!options.changes) {
180
- resultArray[currentResult] = resultArray[currentSource][getBuffer](currentSource)
177
+ result[currentResult] = resultArray[currentSource][getBuffer](currentSource)
181
178
  if (options.meta) {
182
179
  const id=odJSONTag.getAttribute(resultArray[currentSource],'id')
183
180
  if (id) {