mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
25 lines
645 B
JavaScript
25 lines
645 B
JavaScript
|
'use strict';
|
||
|
|
||
|
module.exports.PREVIEW_MODE_FRIENDLY = 'friendly';
|
||
|
module.exports.PREVIEW_MODE_SOURCE = 'source';
|
||
|
module.exports.PREVIEW_MODE_RAW = 'raw';
|
||
|
|
||
|
const previewModeMap = {
|
||
|
[module.exports.PREVIEW_MODE_FRIENDLY]: 'Visual',
|
||
|
[module.exports.PREVIEW_MODE_SOURCE]: 'Source',
|
||
|
[module.exports.PREVIEW_MODE_RAW]: 'Raw'
|
||
|
};
|
||
|
|
||
|
module.exports.PREVIEW_MODES = Object.keys(previewModeMap);
|
||
|
|
||
|
/**
|
||
|
* Get the friendly name for a given preview mode
|
||
|
*
|
||
|
* @param previewMode
|
||
|
* @returns {*|string}
|
||
|
*/
|
||
|
module.exports.getPreviewModeName = previewMode => {
|
||
|
// TODO: Make this more robust maybe...
|
||
|
return previewModeMap[previewMode] || 'Unknown';
|
||
|
};
|