40 { reusableObjectsLocation: `#/components/${type}` },
41 context
42 );
43 if (resultsForType !== void 0 && Array.isArray(resultsForType)) {44 results.push(...resultsForType);
45 }
46 }
5const pathRegex = /(\{;?\??[a-zA-Z0-9_-]+\*?\})/g;
6
7const isNamedPathParam = (p) => {
8 return p.in !== void 0 && p.in === "path" && p.name !== void 0; 9};
10
11const isUnknownNamedPathParam = (p, path, results, seen) => {
5const pathRegex = /(\{;?\??[a-zA-Z0-9_-]+\*?\})/g;
6
7const isNamedPathParam = (p) => {
8 return p.in !== void 0 && p.in === "path" && p.name !== void 0; 9};
10
11const isUnknownNamedPathParam = (p, path, results, seen) => {
247 });
248
249 if (Array.isArray(result)) {
250 if (results === void 0) results = [];251 results.push(...result);
252 }
253 }
214 opts.schemaField === "$" ? targetVal : targetVal[opts.schemaField],
215 };
216
217 let results = void 0;218 let oasVersion = parseInt(opts.oasVersion);
219
220 const validationItems =
A return;
statement with nothing after it is redundant, and has no effect on the runtime behavior of a function.
This can be confusing, so it's better to disallow these redundant statements.
function foo() { return; }
function foo() {
doSomething();
return;
}
function foo() {
if (condition) {
bar();
return;
} else {
baz();
}
}
function foo() {
switch (bar) {
case 1:
doSomething();
default:
doSomethingElse();
return;
}
}
function foo() { return 5; }
function foo() {
return doSomething();
}
function foo() {
if (condition) {
bar();
return;
} else {
baz();
}
qux();
}
function foo() {
switch (bar) {
case 1:
doSomething();
return;
default:
doSomethingElse();
}
}
function foo() {
for (const foo of bar) {
return;
}
}