MCPcopy
hub / github.com/YMFE/yapi / handleBasepath

Method handleBasepath

server/controllers/project.js:119–136  ·  view source on GitHub ↗
(basepath)

Source from the content-addressed store, hash-verified

117 }
118
119 handleBasepath(basepath) {
120 if (!basepath) {
121 return '';
122 }
123 if (basepath === '/') {
124 return '';
125 }
126 if (basepath[0] !== '/') {
127 basepath = '/' + basepath;
128 }
129 if (basepath[basepath.length - 1] === '/') {
130 basepath = basepath.substr(0, basepath.length - 1);
131 }
132 if (!/^\/[a-zA-Z0-9\-\/\._]+$/.test(basepath)) {
133 return false;
134 }
135 return basepath;
136 }
137
138 verifyDomain(domain) {
139 if (!domain) {

Callers 2

addMethod · 0.95
upMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected