import ts from 'typescript' ; import * as utils from '../utils' ; export type BodiedNode = ts . Node & { readonly body : ts . Node ; } ; export type BodyableNode = ts . Node & { readonly body ? : ts . Node ; } ; export function getBody ( node ) ; export function getBody ( node ) ; export function getBody ( node ) { return utils . getValueOrUndefined ( node . body ) ; } export function getBodyOrThrow ( node ) { return utils . throwIfNullOrUndefined ( getBody ( node ) , 'body' ) ; } export function hasBody < TNode extends BodyableNode > ( node ) { return getBody ( node ) !== undefined ; }