mol_wire_lib 1.0.1056 → 1.0.1057

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/node.js CHANGED
@@ -1378,6 +1378,9 @@ var $;
1378
1378
  if (typeof json === 'string') {
1379
1379
  return $mol_tree2.data(json, [], span);
1380
1380
  }
1381
+ if (typeof json.toJSON === 'function') {
1382
+ return $mol_tree2_from_json(json.toJSON());
1383
+ }
1381
1384
  if (Array.isArray(json)) {
1382
1385
  const sub = json.map(json => $mol_tree2_from_json(json, span));
1383
1386
  return new $mol_tree2('/', '', sub, span);
@@ -1389,9 +1392,6 @@ var $;
1389
1392
  if (json instanceof Date) {
1390
1393
  return new $mol_tree2('', json.toISOString(), [], span);
1391
1394
  }
1392
- if (typeof json.toJSON === 'function') {
1393
- return $mol_tree2_from_json(json.toJSON());
1394
- }
1395
1395
  if (json.toString !== Object.prototype.toString) {
1396
1396
  return $mol_tree2.data(json.toString(), [], span);
1397
1397
  }