mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-17 17:16:38 +08:00
14 lines
328 B
JavaScript
14 lines
328 B
JavaScript
import {CHANNEL_OPTIONS} from '../constants';
|
|
|
|
let channelMap = undefined;
|
|
|
|
export function getChannelOption(channelId) {
|
|
if (channelMap === undefined) {
|
|
channelMap = {};
|
|
CHANNEL_OPTIONS.forEach((option) => {
|
|
channelMap[option.key] = option;
|
|
});
|
|
}
|
|
return channelMap[channelId];
|
|
}
|