Recursively makes all properties of an AstNode optional, except for those
that start with a dollar sign ($) or are of type boolean or are of type array.
If the type is a Reference or an Array, it applies the transformation recursively
to the inner type.
Otherwise the type is returned as is.
Recursively makes all properties of an AstNode optional, except for those that start with a dollar sign ($) or are of type boolean or are of type array. If the type is a Reference or an Array, it applies the transformation recursively to the inner type. Otherwise the type is returned as is.