cleanup and notes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2026-01-06 23:06:28 +03:00
parent 340339b314
commit bf51e04702

View File

@ -33,6 +33,7 @@
* +----- Object attr index * +----- Object attr index
* The questions is which to use as default for objects, the key or * The questions is which to use as default for objects, the key or
* position? * position?
* (XXX move this note to diff.jx)
* *
* *
* *
@ -75,7 +76,8 @@ var debug = {
//--------------------------------------------------------------------- //---------------------------------------------------------------------
module.STRING_LENGTH_REF = 64 module.STRING_LENGTH_REF = RECURSIVE.length * 8
// //
// serialize(obj[, options]) // serialize(obj[, options])
@ -135,7 +137,7 @@ module.STRING_LENGTH_REF = 64
// ] // ]
// //
// //
// XXX BUG: using non-whitespace as indent breaks the depth of the first // XXX BUG?: using non-whitespace as indent breaks the depth of the first
// or last elements in sequences // or last elements in sequences
// ...breaks .trim*() in Map/Set/Object... // ...breaks .trim*() in Map/Set/Object...
var _serialize = var _serialize =
@ -165,7 +167,9 @@ function(obj, path=[], seen=new Map(), indent, depth=0, options={}){
return FUNCTION return FUNCTION
.replace('%', s.length +','+ s) } .replace('%', s.length +','+ s) }
// special case: long strings... // long strings...
// NOTE: this saves on output size...
// XXX is this relevant when we can "zip" the results...
if(typeof(obj) == 'string' if(typeof(obj) == 'string'
&& obj.length > string_length_ref){ && obj.length > string_length_ref){
seen.set(obj, path) } seen.set(obj, path) }