- Complete React app with 7 developer tools - JSON Tool with visual structured editor - Serialize Tool with visual structured editor - URL, Base64, CSV/JSON, Beautifier, Diff tools - Responsive navigation with dropdown menu - Dark/light mode toggle - Mobile-responsive design with sticky header - All tools working with copy/paste functionality
31 lines
897 B
JavaScript
31 lines
897 B
JavaScript
/**
|
|
* Gets the socket integration to use for Webpack messages.
|
|
* @param {'wds' | 'whm' | 'wps' | string} integrationType A valid socket integration type or a path to a module.
|
|
* @returns {string} Path to the resolved socket integration module.
|
|
*/
|
|
function getSocketIntegration(integrationType) {
|
|
let resolvedSocketIntegration;
|
|
switch (integrationType) {
|
|
case 'wds': {
|
|
resolvedSocketIntegration = require.resolve('../../sockets/WDSSocket');
|
|
break;
|
|
}
|
|
case 'whm': {
|
|
resolvedSocketIntegration = require.resolve('../../sockets/WHMEventSource');
|
|
break;
|
|
}
|
|
case 'wps': {
|
|
resolvedSocketIntegration = require.resolve('../../sockets/WPSSocket');
|
|
break;
|
|
}
|
|
default: {
|
|
resolvedSocketIntegration = require.resolve(integrationType);
|
|
break;
|
|
}
|
|
}
|
|
|
|
return resolvedSocketIntegration;
|
|
}
|
|
|
|
module.exports = getSocketIntegration;
|