MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / resolveConfigPath

Function resolveConfigPath

node/cli.js:140–154  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

138}
139
140function resolveConfigPath(config) {
141 if (BUILT_IN_CONFIG_NAMES.has(config) || OPTIONAL_JIEBA_CONFIGS.has(config) || path.isAbsolute(config)) {
142 return config;
143 }
144
145 if (!config.endsWith('.json') && BUILT_IN_CONFIG_STEMS.has(config)) {
146 return config + '.json';
147 }
148
149 if (!config.endsWith('.json') && OPTIONAL_JIEBA_CONFIG_STEMS.has(config)) {
150 return config + '.json';
151 }
152
153 return path.resolve(process.cwd(), config);
154}
155
156function createConverterStream(converter) {
157 const nativeStream = converter._createConverterStream();

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected