From 71d28aabc95f853386c69a0fe3fe1125932cfb0b Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 11 Jun 2026 17:09:27 +0300 Subject: [PATCH] added .toVanilla(..) func... Signed-off-by: Alex A. Naanou --- README.md | 12 ++++++++++++ package.json | 2 +- serialize.js | 9 +++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b958664..8ba152a 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,18 @@ eJSON.parse(, {functions: }) ``` +### `toVanilla(..)` + +Convert eJSON formatted string to Vanilla JSON string. + +``` +toVanilla() + -> +``` + +Note that this will fail on anny data not supported by the Vanilla `JOSN.stringify(..)`. + + ### `deepCopy(..)` Deep-copy an object. diff --git a/package.json b/package.json index 8af2cda..f7ab73b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-serialize", - "version": "1.3.3", + "version": "1.3.4", "description": "experimental extended json serializaion...", "main": "serialize.js", "scripts": { diff --git a/serialize.js b/serialize.js index 744989f..e25e1a5 100644 --- a/serialize.js +++ b/serialize.js @@ -788,6 +788,15 @@ function(str, options){ //--------------------------------------------------------------------- // utils... + +// NOTE: this will fail on any non-vanilla data... +var toVanilla = +module.toVanilla = +function(str){ + return JSON.stringify( + deserialize(str)) } + + var deepCopy = module.deepCopy = function(obj, funcs=true){