import { getOptions } from "loader-utils" ; import { IAssociate } from "custom-functions-metadata" ; import CustomFunctionsMetadataPlugin from "./customfunctionsplugin" ; function addFunctionAssociations ( this , source ) { const input = getOptions ( this ) . input as string ; if ( ! CustomFunctionsMetadataPlugin . generateResults [ input ] ) { return source ; } CustomFunctionsMetadataPlugin . generateResults [ input ] . associate . forEach ( ( item ) => { source += `\nCustomFunctions.associate("${ item . id }", ${ item . functionName });` ; } ) ; return source ; } export = addFunctionAssociations ;