Skip to content

Commit

Permalink
SB: added handler if node is null
Browse files Browse the repository at this point in the history
  • Loading branch information
00salmon committed Nov 25, 2019
1 parent f5126cf commit 3e0605b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { JsonataASTNode, ObjectUnaryNode, ArrayUnaryNode } from "./types";
type AST = JsonataASTNode;

export default function serializer(node: AST): string {
if(!node) return undefined;
if (node.type === "binary") {
return serializer(node.lhs) + " " + node.value + " " + serializer(node.rhs);
} else if (node.type === "function") {
Expand Down

0 comments on commit 3e0605b

Please sign in to comment.