export default function appendFn ( options , name , fns ) { if ( ! options [ name ] ) { options [ name ] = function ( ... args ) { fns . forEach ( fn => { fn . call ( this , ... args ) ; } ) ; } ; } else if ( typeof options [ name ] === 'function' ) { options [ name ] = function ( ... args ) { options [ name ] . call ( this , ... args ) ; fns . forEach ( fn => { fn . call ( this , ... args ) ; } ) ; } ; } else { throw new Error ( `The '${ name }' prop is not a 'function' prop.` ) ; } }