File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/netcore/Fable.Client.Browser/demo Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 325325 function isObject ( x ) {
326326 return x !== null && typeof x === "object" && ! ( x instanceof Number ) && ! ( x instanceof String ) && ! ( x instanceof Boolean ) ;
327327 }
328- let mkArray = function ( k , v ) {
328+ let fixValue = function ( k , v ) {
329329 return v && v [ Symbol . iterator ] && ! Array . isArray ( v ) && isObject ( v ) ? Array . from ( v )
330330 : v && v . Case && v . Fields && Array . isArray ( v . Fields ) ?
331331 v . Fields . length == 1 ? v . Fields [ 0 ] : v . Fields . length > 1 ? v . Fields : v . Case
332332 : ( k . startsWith ( "directives@" ) || k . startsWith ( "specifiers@" ) ) && ! v ? [ ] : v ;
333333 } ;
334- let astJson = JSON . stringify ( ast , mkArray )
335- . replace ( / " t y p " / g, '"type"' )
336- . replace ( / @ [ 0 - 9 ] + / g, '' )
337- . replace ( / " a r g u m e n t s " : / g, '"params":' ) ;
334+ let astJson = JSON . stringify ( ast , fixValue )
335+ . replace ( / " t y p " : / g, '"type": ' )
336+ . replace ( / @ [ 0 - 9 ] + " / g, '" ' )
337+ . replace ( / " a r g s " : / g, '"params":' ) ;
338338 let newAst = JSON . parse ( astJson ) ;
339339 return newAst ;
340340 }
You can’t perform that action at this time.
0 commit comments