1 line
1.1 KiB
Plaintext
1 line
1.1 KiB
Plaintext
{"version":3,"file":"detectWebp.mjs","sources":["../../../../src/assets/detections/parsers/detectWebp.ts"],"sourcesContent":["import { ExtensionType } from '../../../extensions/Extensions';\nimport { testImageFormat } from '../utils/testImageFormat';\n\nimport type { FormatDetectionParser } from '../types';\n\n/**\n * Detects if the browser supports the WebP image format.\n * @memberof assets\n */\nexport const detectWebp = {\n extension: {\n type: ExtensionType.DetectionParser,\n priority: 0,\n },\n test: async (): Promise<boolean> => testImageFormat(\n 'data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA='\n ),\n add: async (formats) => [...formats, 'webp'],\n remove: async (formats) => formats.filter((f) => f !== 'webp'),\n} as FormatDetectionParser;\n"],"names":[],"mappings":";;;;AASO,MAAM,UAAa,GAAA;AAAA,EACtB,SAAW,EAAA;AAAA,IACP,MAAM,aAAc,CAAA,eAAA;AAAA,IACpB,QAAU,EAAA,CAAA;AAAA,GACd;AAAA,EACA,MAAM,YAA8B,eAAA;AAAA,IAChC,6EAAA;AAAA,GACJ;AAAA,EACA,KAAK,OAAO,OAAA,KAAY,CAAC,GAAG,SAAS,MAAM,CAAA;AAAA,EAC3C,MAAA,EAAQ,OAAO,OAAY,KAAA,OAAA,CAAQ,OAAO,CAAC,CAAA,KAAM,MAAM,MAAM,CAAA;AACjE;;;;"} |