From 87a033f607f9bd2526f6b8864685f0b6cb7d9b75 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 23 Feb 2025 14:47:31 +0300 Subject: [PATCH] docs... Signed-off-by: Alex A. Naanou --- serialize.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/serialize.js b/serialize.js index 67102fd..148bfdc 100644 --- a/serialize.js +++ b/serialize.js @@ -160,8 +160,13 @@ function(str, funcs){ //--------------------------------------------------------------------- -// colning... +// copying/colning... +// Deep copy an object tree... +// +// This is similar to JSON.parse(JSON.stringify(..)) but uses deserialize +// and serialize. +// // NOTE: this will try and reconstruct functions from the input tree, // this will work fine for simple functions but more complex cases // may yield unexpected results -- this is not done to full depth, @@ -176,8 +181,9 @@ function(obj){ return deserialize( serialize(obj)) } -// NOTE: this will not recreate functions, rather it will simply reref -// functions from the input to the output... + +// This is the same as semiDeepCopy(..) but instead of recreating +// functions, it will simply rereference them from the input... var semiDeepCopy = module.semiDeepCopy = function(obj){ @@ -188,5 +194,6 @@ function(obj){ + /********************************************************************** * vim:set ts=4 sw=4 : */ return module })