{"version":3,"file":"ngxtension-call-apply.mjs","sources":["../../../../libs/ngxtension/call-apply/src/call-apply.ts","../../../../libs/ngxtension/call-apply/src/ngxtension-call-apply.ts"],"sourcesContent":["import { Pipe, type PipeTransform } from '@angular/core';\n\nconst error_this = function () {\n\tthrow new Error(\n\t\t`DON'T USE this INSIDE A FUNCTION CALLED BY | call OR | apply IT MUST BE A PURE FUNCTION!`,\n\t);\n};\nconst NOTHIS =\n\ttypeof Proxy !== 'function'\n\t\t? Object.seal({})\n\t\t: new Proxy(\n\t\t\t\t{},\n\t\t\t\t{\n\t\t\t\t\tget: error_this,\n\t\t\t\t\tset: error_this,\n\t\t\t\t\tdeleteProperty: error_this,\n\t\t\t\t\thas: error_this,\n\t\t\t\t},\n\t\t\t);\n\n@Pipe({\n\tname: 'call',\n\tpure: true,\n\tstandalone: true,\n})\nexport class CallPipe implements PipeTransform {\n\ttransform<T = any, R = any>(value: T, args?: (param: T) => R): R {\n\t\tif (typeof args !== 'function')\n\t\t\tthrow new TypeError('You must pass a PURE function to | call');\n\t\treturn args?.call(NOTHIS, value);\n\t}\n}\n\n@Pipe({\n\tname: 'apply',\n\tpure: true,\n\tstandalone: true,\n})\nexport class ApplyPipe implements PipeTransform {\n\ttransform<TFunction extends (...args: any[]) => any>(\n\t\tfn: TFunction,\n\t\t...args: Parameters<TFunction>\n\t): ReturnType<TFunction> {\n\t\tif (typeof fn !== 'function')\n\t\t\tthrow new TypeError('You must use | apply on a PURE function');\n\t\treturn fn.apply(NOTHIS, args);\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,MAAM,UAAU,GAAG,YAAA;AAClB,IAAA,MAAM,IAAI,KAAK,CACd,CAAA,wFAAA,CAA0F,CAC1F,CAAC;AACH,CAAC,CAAC;AACF,MAAM,MAAM,GACX,OAAO,KAAK,KAAK,UAAU;AAC1B,MAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;AACjB,MAAE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