Options
All
  • Public
  • Public/Protected
  • All
Menu

Module patcher

Index

Type aliases

PatchCallback: (self: any, args: any[], res: any) => void | any

Type declaration

    • (self: any, args: any[], res: any): void | any
    • Callback for a patch.

      Parameters

      • self: any

        A reference to this in the context of the patched function.

      • args: any[]

        The list of arguments sent to the patched function.

      • res: any

        A reference to the original function for before and instead patches, and the result of the original function for after patches.

      Returns void | any

      The new arguments or return value of the function. To keep the original arguments or return value (probably modified in place in the function body), don't return anything.

Functions

  • after(caller: string, mdl: any, func: string, callback: PatchCallback): () => void
  • Creates an after patch.

    Patch will be executed after the original function has been called.

    Parameters

    Returns () => void

      • (): void
      • Creates an after patch.

        Patch will be executed after the original function has been called.

        Returns void

  • before(caller: string, mdl: any, func: string, callback: PatchCallback): () => void
  • Creates a before patch.

    Patch will be executed before the original function is called.

    Parameters

    Returns () => void

      • (): void
      • Creates a before patch.

        Patch will be executed before the original function is called.

        Returns void

  • instead(caller: string, mdl: any, func: string, callback: PatchCallback): () => void
  • Creates an instead patch.

    Patch will replace the original function call.

    Parameters

    Returns () => void

      • (): void
      • Creates an instead patch.

        Patch will replace the original function call.

        Returns void

Generated using TypeDoc