Function proxyAssign

  • Effectively assigns all enumerable properties (not just own properties) and functions (including inherited prototype) from the source object to the target, it attempts to use proxy getters / setters (if possible) and proxy functions to avoid potential implementation issues by assigning prototype functions as instance ones

    This method is the primary method used to "update" the snippet proxy with the ultimate implementations.

    Special ES3 Notes: Updates (setting) of direct property values on the target or indirectly on the source object WILL NOT WORK PROPERLY, updates to the properties of "referenced" object will work (target.context.newValue = 10 => will be reflected in the source.context as it's the same object). ES3 Failures: assigning target.myProp = 3 -> Won't change source.myProp = 3, likewise the reverse would also fail.

    Type Parameters

    • T

    • S

    Parameters

    • target: T

      The target object to be assigned with the source properties and functions

    • source: S

      The source object which will be assigned / called by setting / calling the targets proxies

    • Optional chkSet: ((name, isFunc?, source?, target?) => boolean)

      An optional callback to determine whether a specific property/function should be proxied

        • (name, isFunc?, source?, target?): boolean
        • Parameters

          • name: string
          • Optional isFunc: boolean
          • Optional source: S
          • Optional target: T

          Returns boolean

    Returns T

Generated using TypeDoc