Skip to content

Commit

Permalink
unpack outer wrapper in $string()
Browse files Browse the repository at this point in the history
Signed-off-by: andrew-coleman <[email protected]>
  • Loading branch information
andrew-coleman committed Mar 23, 2020
1 parent 17c65e3 commit 18b59b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ const functions = (() => {
};
} else {
var space = prettify ? 2 : 0;
if(Array.isArray(arg) && arg.outerWrapper) {
arg = arg[0];
}
str = JSON.stringify(arg, function (key, val) {
return (typeof val !== 'undefined' && val !== null && val.toPrecision && isNumeric(val)) ? Number(val.toPrecision(15)) :
(val && isFunction(val)) ? '' : val;
Expand Down
6 changes: 6 additions & 0 deletions test/test-suite/groups/function-string/case029.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"expr": "$string()",
"data": [4, true],
"bindings": {},
"result": "[4,true]"
}

0 comments on commit 18b59b2

Please sign in to comment.