• Prepends a dot to file extension if dot doesn't exist

    Parameters

    • extension: undefined | string

      raw extension

    Returns string | undefined

    file extension with a dot

    getCleanedExtension(''); // undefined
    getCleanedExtension('a'); // '.a'
    getCleanedExtension('.a'); // '.a'
    getCleanedExtension('a.b'); // '.a.b'
    getCleanedExtension('.a.b'); // '.a.b'