MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / resolveGlob

Function resolveGlob

packages/core/src/utils/fs-utils.ts:98–118  ·  view source on GitHub ↗
(input: string | string[], cwd?: string)

Source from the content-addressed store, hash-verified

96 },
97
98 resolveGlob(input: string | string[], cwd?: string): string[] {
99 if (Array.isArray(input)) {
100 return input.flatMap(paths => this.resolveGlob(paths, cwd));
101 }
102
103 const hasGlobChars = /[*?[\]]/.test(input);
104
105 if (!hasGlobChars) {
106 try {
107 const s = statSync(cwd ? this.normalizePath(cwd, input) : input);
108
109 if (s.isDirectory()) {
110 return globSync(join(input, '**'), { cwd });
111 }
112 } catch {
113 // ignore
114 }
115 }
116
117 return globSync(input, { cwd });
118 },
119
120 getPackageConfig<T extends Dictionary>(basePath = process.cwd()): T {
121 if (this.pathExists(`${basePath}/package.json`)) {

Callers

nothing calls this directly

Calls 4

globSyncFunction · 0.85
resolveGlobMethod · 0.80
normalizePathMethod · 0.80
testMethod · 0.65

Tested by

no test coverage detected