{"version":3,"sources":["../../../src/uploads/image-resizing/parseFilename.ts"],"sourcesContent":["import sanitize from 'sanitize-filename'\n\ntype SanitizedImageData = {\n ext: string\n name: string\n}\n\n/**\n * Sanitize the image name and extract the extension from the source image\n *\n * @param sourceImage - the source image\n * @returns the sanitized name and extension\n */\nexport const parseFilename = (sourceImage: string): SanitizedImageData => {\n const extension = sourceImage.split('.').pop()\n const name = sanitize(sourceImage.substring(0, sourceImage.lastIndexOf('.')) || sourceImage)\n return { name, ext: extension! }\n}\n"],"names":["sanitize","parseFilename","sourceImage","extension","split","pop","name","substring","lastIndexOf","ext"],"mappings":"AAAA,OAAOA,cAAc,oBAAmB;AAOxC;;;;;CAKC,GACD,OAAO,MAAMC,gBAAgB,CAACC;IAC5B,MAAMC,YAAYD,YAAYE,KAAK,CAAC,KAAKC,GAAG;IAC5C,MAAMC,OAAON,SAASE,YAAYK,SAAS,CAAC,GAAGL,YAAYM,WAAW,CAAC,SAASN;IAChF,OAAO;QAAEI;QAAMG,KAAKN;IAAW;AACjC,EAAC"}