MCPcopy Create free account
hub / github.com/firebase/firebase-tools / createFilter

Function createFilter

src/apptesting/parseTestFiles.ts:79–90  ·  view source on GitHub ↗
(pattern?: string, context?: string)

Source from the content-addressed store, hash-verified

77}
78
79function createFilter(pattern?: string, context?: string) {
80 try {
81 const regex = pattern ? new RegExp(pattern) : undefined;
82 return (s: string) => !regex || regex.test(s);
83 } catch (ex) {
84 if (ex instanceof SyntaxError) {
85 const errMsg = context ? `Invalid ${context} regex: ${pattern}` : `Invalid regex: ${pattern}`;
86 throw new FirebaseError(errMsg, { original: getError(ex) });
87 }
88 throw ex;
89 }
90}
91
92interface TestCaseFile {
93 path: string;

Callers 1

parseTestFilesFunction · 0.85

Calls 1

getErrorFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…