function fileType(fname) {
    let ftype = 'text'
    const fparts = fname.split('.')
    // Take off the first entry if the file name started with a dot
    if ( fparts[0] === '' ) fparts.shift()
    if (fparts.length > 1) {
        // Get the last element of the array
        const fext = fparts.pop().toLowerCase().trim()
        switch (fext) {
            case 'js':
                ftype = 'javascript'
                break
            case 'html':
            case 'css':
            case 'json':
                ftype = fext
                break
            case 'vue':
                ftype = 'html'
                break
            case 'md':
                ftype = 'markdown'
                break
            case 'yaml':
            case 'yml':
                ftype = 'yaml'
                break
            default:
                ftype = fext
        }
    }
    return ftype
}
Return a file type from a file name (or default to txt)
 ftype can be used in ACE editor modes
@param {string} fname File name for which to return the type
@returns {string} File type