DevCompanion: opinionated hacky changes

This commit is contained in:
Sqaaakoi 2024-08-28 07:24:56 +12:00 committed by sadan4
parent 5851355248
commit b6baaf81b1
2 changed files with 3 additions and 1 deletions

View file

@ -212,6 +212,7 @@ export function initWs(isManual = false) {
let results: any[]; let results: any[];
switch (findType.replace("find", "").replace("Lazy", "")) { switch (findType.replace("find", "").replace("Lazy", "")) {
case "": case "":
case "Component":
results = findAll(parsedArgs[0]); results = findAll(parsedArgs[0]);
break; break;
case "ByProps": case "ByProps":
@ -317,6 +318,7 @@ export function initWs(isManual = false) {
let results: any[]; let results: any[];
switch (type.replace("find", "").replace("Lazy", "")) { switch (type.replace("find", "").replace("Lazy", "")) {
case "": case "":
case "Component":
results = findAll(parsedArgs[0]); results = findAll(parsedArgs[0]);
break; break;
case "ByProps": case "ByProps":

View file

@ -95,7 +95,7 @@ export function findModuleId(find: CodeFilter) {
throw new Error("No Matches Found"); throw new Error("No Matches Found");
} }
if (matches.length !== 1) { if (matches.length !== 1) {
throw new Error("More than one match"); throw new Error(`This filter matches ${matches.length} modules. Make it more specific!`);
} }
return matches[0]; return matches[0];
} }