MCPcopy Create free account
hub / github.com/Semporia/Scripts / requireConfig

Function requireConfig

jd_unsubscribe.js:346–366  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

344}
345
346function requireConfig() {
347 return new Promise(resolve => {
348 if ($.isNode() && process.env.UN_SUBSCRIBES) {
349 if (process.env.UN_SUBSCRIBES.indexOf('&') > -1) {
350 $.UN_SUBSCRIBES = process.env.UN_SUBSCRIBES.split('&');
351 } else if (process.env.UN_SUBSCRIBES.indexOf('\n') > -1) {
352 $.UN_SUBSCRIBES = process.env.UN_SUBSCRIBES.split('\n');
353 } else if (process.env.UN_SUBSCRIBES.indexOf('\\n') > -1) {
354 $.UN_SUBSCRIBES = process.env.UN_SUBSCRIBES.split('\\n');
355 } else {
356 $.UN_SUBSCRIBES = process.env.UN_SUBSCRIBES.split();
357 }
358 console.log(`您环境变量 UN_SUBSCRIBES 设置的内容为:\n${JSON.stringify($.UN_SUBSCRIBES)}`)
359 goodPageSize = $.UN_SUBSCRIBES[0] || goodPageSize;
360 shopPageSize = $.UN_SUBSCRIBES[1] || shopPageSize;
361 stopGoods = $.UN_SUBSCRIBES[2] || stopGoods;
362 stopShop = $.UN_SUBSCRIBES[3] || stopShop;
363 }
364 resolve()
365 })
366}
367
368function jsonParse(str) {
369 if (typeof str == "string") {

Callers 1

jd_unsubscribe.jsFile · 0.70

Calls 2

isNodeMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected