• Returns the file extension of a file, or undefined

    Parameters

    • fileName: string

      file name to get extension of

    Returns string | undefined

    the file extension, or undefined

    getFileExtension('test.ext'); // 'ext'
    getFileExtension('test.doc.ext'); // 'ext'
    getFileExtension('test'); // undefined