{"version":3,"file":"purryOn-DdnETb-0.cjs","names":[],"sources":["../src/internal/purryOn.ts"],"sourcesContent":["/**\n * Utility for purrying functions based on a predicate for the first argument.\n *\n * This is useful for purrying functions with a variadic argument list.\n */\nexport function purryOn<T>(\n  isArg: (firstArg: unknown) => firstArg is T,\n  implementation: (\n    data: unknown,\n    firstArg: T,\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Function inference in typescript relies on `any` to work, it doesn't work with `unknown`\n    ...args: any\n  ) => unknown,\n  args: readonly unknown[],\n): unknown {\n  return isArg(args[0])\n    ? // @ts-expect-error [ts2556] - This is a low-level function that assumes the function declaration and setup is correct and won't result in typing issues when called dynamically.\n      (data: unknown) => implementation(data, ...args)\n    : // @ts-expect-error [ts2556] - This is a low-level function that assumes the function declaration and setup is correct and won't result in typing issues when called dynamically.\n      implementation(...args);\n}\n"],"mappings":"AAKA,SAAgB,EACd,EACA,EAMA,EACS,CACT,OAAO,EAAM,EAAK,GAAG,CAEhB,GAAkB,EAAe,EAAM,GAAG,EAAK,CAEhD,EAAe,GAAG,EAAK"}