mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
Bugfix/Upsert files extension to input field (#3288)
get upsert files extension to input field
This commit is contained in:
@@ -872,6 +872,35 @@ export const getVersion: () => Promise<{ version: string }> = async () => {
|
||||
throw new Error('None of the package.json paths could be parsed')
|
||||
}
|
||||
|
||||
/**
|
||||
* Map Ext to InputField
|
||||
* @param {string} ext
|
||||
* @returns {string}
|
||||
*/
|
||||
export const mapExtToInputField = (ext: string) => {
|
||||
switch (ext) {
|
||||
case '.txt':
|
||||
return 'txtFile'
|
||||
case '.pdf':
|
||||
return 'pdfFile'
|
||||
case '.json':
|
||||
return 'jsonFile'
|
||||
case '.csv':
|
||||
case '.xls':
|
||||
case '.xlsx':
|
||||
return 'csvFile'
|
||||
case '.jsonl':
|
||||
return 'jsonlinesFile'
|
||||
case '.docx':
|
||||
case '.doc':
|
||||
return 'docxFile'
|
||||
case '.yaml':
|
||||
return 'yamlFile'
|
||||
default:
|
||||
return 'txtFile'
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Map MimeType to InputField
|
||||
* @param {string} mimeType
|
||||
|
||||
Reference in New Issue
Block a user