images-set-to-webp-converter
Version:
Powerful util for images (.png | .jpeg | .jpg) set conversion to .webp, generated by Abobe Images Processor Pro plugin
14 lines (9 loc) • 395 B
text/typescript
import { PATH_TO_PARSE } from '../constants'
const getNormalizedPath = () => {
const receivedPath = process.argv.find((arg = '') => arg.match(/^(path=)/i))
if (!receivedPath || receivedPath.length === 0) {
throw new Error(`The path was not provided, aborting! Please, check it: ${PATH_TO_PARSE}`)
}
return receivedPath.replace(/^(path=)/i, '')
}
export default getNormalizedPath