import ts from 'typescript' ; import * as utils from '../utils' ; export type InitializerExpressionedNode = ts . Node & { readonly initializer : ts . Expression ; } ; export type InitializerExpressionableNode = ts . Node & { readonly initializer ? : ts . Expression ; } ; export function getInitializer ( node ) ; export function getInitializer ( node ) ; export function getInitializer ( node ) { return utils . getValueOrUndefined ( node . initializer ) ; } export function getInitializerOrThrow ( node ) { return utils . throwIfNullOrUndefined ( getInitializer ( node ) , 'initializer' ) ; } export function hasInitializer ( node ) { return getInitializer ( node ) !== undefined ; }