@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
1 lines • 984 B
Source Map (JSON)
{"version":3,"file":"optimize-image.mjs","names":[],"sources":["../../../src/services/processed-images/optimize-image.ts"],"sourcesContent":["import type { Readable } from \"node:stream\";\nimport getImageProcessor from \"../../libs/image-processor/get-adapter.js\";\nimport type {\n\tImageProcessorOptions,\n\tImageProcessorResult,\n} from \"../../libs/image-processor/types.js\";\nimport type { ServiceFn } from \"../../utils/services/types.js\";\n\nconst optimizeImage: ServiceFn<\n\t[\n\t\t{\n\t\t\tstream: Readable;\n\t\t\toptions: ImageProcessorOptions;\n\t\t},\n\t],\n\tImageProcessorResult\n> = async (context, data) => {\n\tconst targetProcessor = await getImageProcessor(context.config);\n\treturn await targetProcessor.process(context, {\n\t\tstream: data.stream,\n\t\toptions: data.options,\n\t});\n};\n\nexport default optimizeImage;\n"],"mappings":"0DAQA,MAAM,EAQF,MAAO,EAAS,IAEZ,MAAM,MADiB,EAAkB,EAAQ,MAAM,EAAA,CACjC,QAAQ,EAAS,CAC7C,OAAQ,EAAK,OACb,QAAS,EAAK,OACf,CAAC"}