added .toVanilla(..) func...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2026-06-11 17:09:27 +03:00
parent 5d0beb3bc7
commit 71d28aabc9
3 changed files with 22 additions and 1 deletions

View File

@ -199,6 +199,18 @@ eJSON.parse(<string>, {functions: <functions>})
``` ```
### `toVanilla(..)`
Convert eJSON formatted string to Vanilla JSON string.
```
toVanilla(<eJSON-string>)
-> <JSON-string>
```
Note that this will fail on anny data not supported by the Vanilla `JOSN.stringify(..)`.
### `deepCopy(..)` ### `deepCopy(..)`
Deep-copy an object. Deep-copy an object.

View File

@ -1,6 +1,6 @@
{ {
"name": "ig-serialize", "name": "ig-serialize",
"version": "1.3.3", "version": "1.3.4",
"description": "experimental extended json serializaion...", "description": "experimental extended json serializaion...",
"main": "serialize.js", "main": "serialize.js",
"scripts": { "scripts": {

View File

@ -788,6 +788,15 @@ function(str, options){
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// utils... // utils...
// NOTE: this will fail on any non-vanilla data...
var toVanilla =
module.toVanilla =
function(str){
return JSON.stringify(
deserialize(str)) }
var deepCopy = var deepCopy =
module.deepCopy = module.deepCopy =
function(obj, funcs=true){ function(obj, funcs=true){