@finos/legend-shared
Advanced tools
Comparing version 8.0.4 to 8.0.5
@@ -39,2 +39,3 @@ /** | ||
} | ||
export declare const getContentTypeFileExtension: (type: ContentType) => string; | ||
/** | ||
@@ -41,0 +42,0 @@ * NOTE: the latter headers value will override the those of the first |
@@ -59,2 +59,15 @@ /** | ||
}; | ||
// NOTE: We could further improve this by using the MIME library https://flaviocopes.com/node-get-file-extension-mime-type/ | ||
export const getContentTypeFileExtension = (type) => { | ||
switch (type) { | ||
case ContentType.APPLICATION_JSON: | ||
return 'json'; | ||
case ContentType.APPLICATION_XML: | ||
return 'xml'; | ||
case ContentType.TEXT_CSV: | ||
return 'csv'; | ||
default: | ||
return 'txt'; | ||
} | ||
}; | ||
/** | ||
@@ -61,0 +74,0 @@ * NOTE: the latter headers value will override the those of the first |
{ | ||
"name": "@finos/legend-shared", | ||
"version": "8.0.4", | ||
"version": "8.0.5", | ||
"description": "Legend Studio shared utilities and helpers", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
{ | ||
"name": "@finos/legend-shared", | ||
"version": "8.0.4", | ||
"version": "8.0.5", | ||
"description": "Legend Studio shared utilities and helpers", | ||
@@ -63,3 +63,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@finos/legend-dev-utils": "2.0.49", | ||
"@finos/legend-dev-utils": "2.0.51", | ||
"@jest/globals": "29.5.0", | ||
@@ -66,0 +66,0 @@ "cross-env": "7.0.3", |
@@ -72,2 +72,16 @@ /** | ||
// NOTE: We could further improve this by using the MIME library https://flaviocopes.com/node-get-file-extension-mime-type/ | ||
export const getContentTypeFileExtension = (type: ContentType): string => { | ||
switch (type) { | ||
case ContentType.APPLICATION_JSON: | ||
return 'json'; | ||
case ContentType.APPLICATION_XML: | ||
return 'xml'; | ||
case ContentType.TEXT_CSV: | ||
return 'csv'; | ||
default: | ||
return 'txt'; | ||
} | ||
}; | ||
/** | ||
@@ -74,0 +88,0 @@ * NOTE: the latter headers value will override the those of the first |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
385606
7081