import { StringMap } from "./api" ; const FUNCTIONS = { } ; export function registerDebuggedFunction ( name , fn ) { if ( FUNCTIONS [ name ] ) { throw new Error ( `There is already a function registered with name "${ name }".` ) ; } FUNCTIONS [ name ] = fn ; } export function isRegistered ( name ) { return ! ! FUNCTIONS [ name ] ; } export function getRegistered ( name ) { const result = FUNCTIONS [ name ] ; if ( ! result ) throw new Error ( `No function registered with name ${ name }.` ) ; return result ; }