MCPcopy Index your code
hub / github.com/MALSync/MALSync / logFoundUrls

Function logFoundUrls

webpackConfig/autoUrls.mjs:248–280  ·  view source on GitHub ↗

* Logs the url(s) found in page, chibi or player. * @param {'page' | 'chibi' | 'player'} type - The type of url (sets log message)

(key, urls, type = URL_TYPES.CHIBI)

Source from the content-addressed store, hash-verified

246 * @param {'page' | 'chibi' | 'player'} type - The type of url (sets log message)
247 */
248function logFoundUrls(key, urls, type = URL_TYPES.CHIBI) {
249 switch (type) {
250 case 'page':
251 if (urls.length <= 0) {
252 console.log(`\n[${key}] No Page found`);
253 } else if (urls.length === 1) {
254 console.log(`\n[${key}] Page found:\n`, urls[0]);
255 } else if (urls.length > 1) {
256 console.log(`\n[${key}] Pages found:\n`, urls.join(',\n '));
257 }
258 break;
259 case 'chibi':
260 if (urls.length <= 0) {
261 console.log(`\n[${key}] No Chibi found`);
262 } else if (urls.length === 1) {
263 console.log(`\n[${key}] Chibi found:\n`, urls[0]);
264 } else if (urls.length > 1) {
265 console.log(`\n[${key}] Chibis found:\n`, urls.join(',\n '));
266 }
267 break;
268 case 'player':
269 if (urls.length <= 0) {
270 console.log(`\n[${key}] No Player found`);
271 } else if (urls.length === 1) {
272 console.log(`\n[${key}] Player found:\n`, urls[0]);
273 } else if (urls.length > 1) {
274 console.log(`\n[${key}] Players found:\n`, urls.join(',\n'));
275 }
276 break;
277 default:
278 throw new Error('Invalid type provided.');
279 }
280}
281
282async function start() {
283 const args = process.argv.slice(2);

Callers 3

addPageUrlsFunction · 0.85
addChibiUrlsFunction · 0.85
addPlayerUrlsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected