{"version":3,"file":"convert_threshold_unit.mjs","names":[],"sources":["../../src/shared/convert_threshold_unit.ts"],"sourcesContent":["export function convertThresholdUnit(\n\t{ failureThresholdType, width, height }: { failureThresholdType: 'pixel' | 'percent'; width: number; height: number },\n\tpixelDiff: number,\n): number {\n\tswitch (failureThresholdType) {\n\t\tcase 'pixel':\n\t\t\treturn pixelDiff\n\t\tcase 'percent':\n\t\t\treturn (pixelDiff / (width * height)) * 100\n\t\tdefault:\n\t\t\tthrow new Error(`Unsupported failureThresholdType: ${failureThresholdType}`)\n\t}\n}\n"],"mappings":";AAAA,SAAgB,qBACf,EAAE,sBAAsB,OAAO,UAC/B,WACS;AACT,SAAQ,sBAAR;EACC,KAAK,QACJ,QAAO;EACR,KAAK,UACJ,QAAQ,aAAa,QAAQ,UAAW;EACzC,QACC,OAAM,IAAI,MAAM,qCAAqC,uBAAuB"}