Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/mask-arguments/docs/types/index.d"

Index

Functions

Functions

Export assignment maskArguments

  • maskArguments(fcn: Function, mask: Collection, thisArg?: any): Function
  • Returns a function that applies arguments to a provided function according to a specified mask.

    Notes

    • Only those arguments having a truthy mask value are applied to a provided function.

    Parameters

    • fcn: Function

      input function

    • mask: Collection

      argument mask

    • Optional thisArg: any

      function context

    Returns Function

    function wrapper

    Example

    function foo( a, b ) {
        return [ a, b ];
    }
    
    var bar = maskArguments( foo, [ 1, 0, 1 ] );
    
    var out = bar( 1, 2, 3 );
    // returns [ 1, 3 ]