UNPKG

1.56 kBSource Map (JSON)View Raw
1{"version":3,"sources":["util/bindcallback.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAAS,EAAE,OAAY,EAAE,QAAgB;IACpE,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QAClC,OAAO,IAAI,CAAC;KACb;IACD,QAAQ,QAAQ,EAAE;QAClB,KAAK,CAAC;YACJ,OAAO;gBACL,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5B,CAAC,CAAC;QACJ,KAAK,CAAC;YACJ,OAAO,UAAU,GAAQ;gBACvB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YACjC,CAAC,CAAC;QACJ,KAAK,CAAC;YACJ,OAAO,UAAU,KAAU,EAAE,KAAa;gBACxC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;YAC1C,CAAC,CAAC;QACJ,KAAK,CAAC;YACJ,OAAO,UAAU,KAAU,EAAE,KAAa,EAAE,UAAiB;gBAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;YACtD,CAAC,CAAC;QACJ;YACE,OAAO;gBACL,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YACxC,CAAC,CAAC;KACH;AACH,CAAC","file":"bindcallback.js","sourcesContent":["/**\n * @ignore\n */\nexport function bindCallback(func: any, thisArg: any, argCount: number) {\n if (typeof thisArg === 'undefined') {\n return func;\n }\n switch (argCount) {\n case 0:\n return function () {\n return func.call(thisArg);\n };\n case 1:\n return function (arg: any) {\n return func.call(thisArg, arg);\n };\n case 2:\n return function (value: any, index: number) {\n return func.call(thisArg, value, index);\n };\n case 3:\n return function (value: any, index: number, collection: any[]) {\n return func.call(thisArg, value, index, collection);\n };\n default:\n return function () {\n return func.apply(thisArg, arguments);\n };\n }\n}\n"]}
\No newline at end of file