module import type { Effect } from './types/effect' ; import permutation2 from './permutation/permutation-2' ; import type { VariadicFunction } from './types/function' ; /**
 * Injects a function with a side effect.
 * Returns the copy of the original function.
 */ export default function inject < Function extends VariadicFunction > ( effect ) ; /**
 * Injects a function with a side effect.
 * Returns the copy of the original function.
 */ export default function inject < Function extends VariadicFunction > ( fn , effect ) ; export default function inject ( ... args ) { return permutation2 ( < Function extends VariadicFunction > ( fn , effect ) => { return ( ( ... args ) => { effect ( ... args as Parameters < Function > ) ; return fn ( ... args ) ; } ) as Function ; } ) ( ... args ) ; }