Skip to content

Commit db1236d

Browse files
author
James Brundage
committed
JSON Template Transpiler - Converting non-primitive objects to JSON (Fixes #382)
1 parent 7c08791 commit db1236d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Transpilers/Templates/Json.Template.psx.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ begin {
4646
$endComment = '\*/' # * End Comments ```/*```
4747
$Whitespace = '[\s\n\r]{0,}'
4848
# * IgnoredContext ```String.empty```, ```null```, blank strings and characters
49-
$IgnoredContext = "(?<ignore>(?>$("null", '""', "\{\}", "\[\]" -join '|'))\s{0,}){0,1}"
49+
$IgnoredContext = "(?<ignore>(?>$('null', '""', '\{\}', '\[\]' -join '|'))\s{0,}){0,1}"
5050
# * StartRegex ```$IgnoredContext + $StartComment + '{' + $Whitespace```
5151
$startRegex = "(?<PSStart>${IgnoredContext}${startComment}\{$Whitespace)"
5252
# * EndRegex ```$whitespace + '}' + $EndComment + $ignoredContext```
@@ -73,7 +73,7 @@ process {
7373
$splat.ForeachObject = {
7474
$in = $_
7575
if (($in -is [string]) -or
76-
($in -ne $null -and $in.GetType().IsPrimitive)) {
76+
($in.GetType -and $in.GetType().IsPrimitive)) {
7777
$in
7878
} else {
7979
ConvertTo-Json -Depth 100 -InputObject $in

0 commit comments

Comments
 (0)