mol_tree2 1.0.734 → 1.0.736
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 +3 -3
- package/node.js.map +1 -1
- package/node.mjs +3 -3
- package/node.test.js +3 -3
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.js +3 -3
- package/web.js.map +1 -1
- package/web.mjs +3 -3
package/node.js
CHANGED
|
@@ -613,6 +613,9 @@ var $;
|
|
|
613
613
|
if (typeof json === 'string') {
|
|
614
614
|
return $mol_tree2.data(json, [], span);
|
|
615
615
|
}
|
|
616
|
+
if (typeof json.toJSON === 'function') {
|
|
617
|
+
return $mol_tree2_from_json(json.toJSON());
|
|
618
|
+
}
|
|
616
619
|
if (Array.isArray(json)) {
|
|
617
620
|
const sub = json.map(json => $mol_tree2_from_json(json, span));
|
|
618
621
|
return new $mol_tree2('/', '', sub, span);
|
|
@@ -624,9 +627,6 @@ var $;
|
|
|
624
627
|
if (json instanceof Date) {
|
|
625
628
|
return new $mol_tree2('', json.toISOString(), [], span);
|
|
626
629
|
}
|
|
627
|
-
if (typeof json.toJSON === 'function') {
|
|
628
|
-
return $mol_tree2_from_json(json.toJSON());
|
|
629
|
-
}
|
|
630
630
|
if (json.toString !== Object.prototype.toString) {
|
|
631
631
|
return $mol_tree2.data(json.toString(), [], span);
|
|
632
632
|
}
|