Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
1 line
1.1 KiB
Plaintext
1 line
1.1 KiB
Plaintext
{"version":3,"sources":["../../../src/uploads/image-resizing/sanitizeResizeConfig.ts"],"sourcesContent":["import type { ImageSize } from '../types.js'\n\n/**\n * Sanitize the resize config. If the resize config has the `withoutReduction`\n * property set to true, the `fit` and `position` properties will be set to `contain`\n * and `top left` respectively.\n *\n * @param resizeConfig - the resize config\n * @returns a sanitized resize config\n */\nexport const sanitizeResizeConfig = (resizeConfig: ImageSize): ImageSize => {\n if (resizeConfig.withoutReduction) {\n return {\n ...resizeConfig,\n // Why fit `contain` should also be set to https://github.com/lovell/sharp/issues/3595\n fit: resizeConfig?.fit || 'contain',\n position: resizeConfig?.position || 'left top',\n }\n }\n return resizeConfig\n}\n"],"names":["sanitizeResizeConfig","resizeConfig","withoutReduction","fit","position"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,MAAMA,uBAAuB,CAACC;IACnC,IAAIA,aAAaC,gBAAgB,EAAE;QACjC,OAAO;YACL,GAAGD,YAAY;YACf,sFAAsF;YACtFE,KAAKF,cAAcE,OAAO;YAC1BC,UAAUH,cAAcG,YAAY;QACtC;IACF;IACA,OAAOH;AACT,EAAC"} |