Options
All
  • Public
  • Public/Protected
  • All
Menu

Module FunctionProxyResolver

Support module for wrapping and unwrapping function (methods) fetched within proxies, as those function may have problem of resolving this when called directly, especial with native objects such as Date.

Index

Functions

register

  • register(resolver: function): void
  • Register a proxy to source resolver.

    Parameters

    • resolver: function

      Resolver function that takes the proxy and returns the source.

        • (source: any): any
        • Parameters

          • source: any

          Returns any

    Returns void

resolve

  • resolve(source: any): any

resolveAll

  • resolveAll(sources: ArrayLike<any>): Object[]
  • Resolve an array of values to unproxied one. This may be use to chain the output with arguments.

    Parameters

    • sources: ArrayLike<any>

      An array-like object contains the sources may be or may not be proxied.

    Returns Object[]

unwrap

  • unwrap(value: unknown): unknown
  • Unwrap a wrapped function to the original one. This will do nothing if the value provided is not a wrapped function.

    Parameters

    • value: unknown

      The value maybe a warpped function.

    Returns unknown

wrap

  • wrap(value: unknown): unknown
  • Wrap a raw function to give ability to resolve proxified this problem. This will do nothing if the value provided is not a function.

    Parameters

    • value: unknown

      The value maybe original function.

    Returns unknown

Generated using TypeDoc