MCPcopy
hub / github.com/jef/streetmerchant / buildProductString

Function buildProductString

src/logger.ts:244–267  ·  view source on GitHub ↗
(link: Link, store: Store, color?: boolean)

Source from the content-addressed store, hash-verified

242}
243
244function buildProductString(link: Link, store: Store, color?: boolean): string {
245 if (color) {
246 if (store.currentProxyIndex !== undefined && store.proxyList) {
247 const proxy = `${store.currentProxyIndex + 1}/${store.proxyList.length}`;
248 return (
249 chalk.gray(`[${proxy}]`) +
250 chalk.cyan(` [${store.name}]`) +
251 chalk.grey(` [${link.brand} (${link.series})] ${link.model}`)
252 );
253 } else {
254 return (
255 chalk.cyan(`[${store.name}]`) +
256 chalk.grey(` [${link.brand} (${link.series})] ${link.model}`)
257 );
258 }
259 }
260
261 if (store.currentProxyIndex !== undefined && store.proxyList) {
262 const proxy = `${store.currentProxyIndex + 1}/${store.proxyList.length}`;
263 return `[${proxy}] [${store.name}] [${link.brand} (${link.series})] ${link.model}`;
264 } else {
265 return `[${store.name}] [${link.brand} (${link.series})] ${link.model}`;
266 }
267}

Callers 12

backoffFunction · 0.85
badStatusCodeFunction · 0.85
bannedSellerFunction · 0.85
captchaFunction · 0.85
cloudflareFunction · 0.85
inStockFunction · 0.85
inStockWaitingFunction · 0.85
maxPriceFunction · 0.85
noResponseFunction · 0.85
outOfStockFunction · 0.85
rateLimitFunction · 0.85
recursionLimitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected