MCPcopy
hub / github.com/uku/Unblock-Youku / stringifyPatterns

Function stringifyPatterns

src/modules/_url_utils.mjs:74–98  ·  view source on GitHub ↗
(hostnameMap)

Source from the content-addressed store, hash-verified

72 }
73
74 function stringifyPatterns(hostnameMap) {
75 let resStr = '';
76 let i; let patterns = null;
77
78 for (const hostname in hostnameMap) {
79 if (hostnameMap.hasOwnProperty(hostname)) {
80 resStr += ' \'' + hostname + '\': [';
81 patterns = hostnameMap[hostname];
82
83 if (patterns.length === 0) {
84 resStr += '],\n';
85 } else {
86 resStr += '\n';
87 for (i = 0; i < patterns.length; i++) {
88 resStr += ' ' + patterns[i] + ',\n';
89 }
90 resStr = resStr.slice(0, -2) + '\n'; // remove the last ,
91 resStr += ' ],\n';
92 }
93 }
94 }
95 resStr = resStr.slice(0, -2) + '\n'; // remove the last ,
96
97 return resStr;
98 }
99
100 function addPatterns(mapObj, ulist) {
101 let i; let uobj; let hostname; let portpath;

Callers 1

stringifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected