@graphql-tools/git-loader 7.2.22 → 7.3.0-alpha-20230508170453-7db2a594
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.js +4 -3
- package/esm/index.js +4 -3
- package/package.json +1 -1
package/cjs/index.js
CHANGED
|
@@ -60,9 +60,10 @@ class GitLoader {
|
|
|
60
60
|
}
|
|
61
61
|
refsForPaths.get(ref).push(`!${(0, unixify_1.default)(path)}`);
|
|
62
62
|
}
|
|
63
|
+
const maybeLeadingDotSlash = path.startsWith('./') ? './' : '';
|
|
63
64
|
const resolved = [];
|
|
64
65
|
await Promise.all([...refsForPaths.entries()].map(async ([ref, paths]) => {
|
|
65
|
-
resolved.push(...(0, micromatch_1.default)(await (0, load_git_js_1.readTreeAtRef)(ref), paths).map(filePath => `git:${ref}:${filePath}`));
|
|
66
|
+
resolved.push(...(0, micromatch_1.default)(await (0, load_git_js_1.readTreeAtRef)(ref), paths).map(filePath => `git:${ref}:${maybeLeadingDotSlash}${filePath}`));
|
|
66
67
|
}));
|
|
67
68
|
return resolved;
|
|
68
69
|
}
|
|
@@ -88,9 +89,10 @@ class GitLoader {
|
|
|
88
89
|
}
|
|
89
90
|
refsForPaths.get(ref).push(`!${(0, unixify_1.default)(path)}`);
|
|
90
91
|
}
|
|
92
|
+
const maybeLeadingDotSlash = path.startsWith('./') ? './' : '';
|
|
91
93
|
const resolved = [];
|
|
92
94
|
for (const [ref, paths] of refsForPaths.entries()) {
|
|
93
|
-
resolved.push(...(0, micromatch_1.default)((0, load_git_js_1.readTreeAtRefSync)(ref), paths).map(filePath => `git:${ref}:${filePath}`));
|
|
95
|
+
resolved.push(...(0, micromatch_1.default)((0, load_git_js_1.readTreeAtRefSync)(ref), paths).map(filePath => `git:${ref}:${maybeLeadingDotSlash}${filePath}`));
|
|
94
96
|
}
|
|
95
97
|
return resolved;
|
|
96
98
|
}
|
|
@@ -181,7 +183,6 @@ class GitLoader {
|
|
|
181
183
|
try {
|
|
182
184
|
if ((0, is_glob_1.default)(path)) {
|
|
183
185
|
const resolvedPaths = this.resolveGlobsSync(pointer, (0, utils_1.asArray)(options.ignore || []));
|
|
184
|
-
const finalResult = [];
|
|
185
186
|
for (const path of resolvedPaths) {
|
|
186
187
|
if (this.canLoadSync(path)) {
|
|
187
188
|
const results = this.loadSync(path, options);
|
package/esm/index.js
CHANGED
|
@@ -56,9 +56,10 @@ export class GitLoader {
|
|
|
56
56
|
}
|
|
57
57
|
refsForPaths.get(ref).push(`!${unixify(path)}`);
|
|
58
58
|
}
|
|
59
|
+
const maybeLeadingDotSlash = path.startsWith('./') ? './' : '';
|
|
59
60
|
const resolved = [];
|
|
60
61
|
await Promise.all([...refsForPaths.entries()].map(async ([ref, paths]) => {
|
|
61
|
-
resolved.push(...micromatch(await readTreeAtRef(ref), paths).map(filePath => `git:${ref}:${filePath}`));
|
|
62
|
+
resolved.push(...micromatch(await readTreeAtRef(ref), paths).map(filePath => `git:${ref}:${maybeLeadingDotSlash}${filePath}`));
|
|
62
63
|
}));
|
|
63
64
|
return resolved;
|
|
64
65
|
}
|
|
@@ -84,9 +85,10 @@ export class GitLoader {
|
|
|
84
85
|
}
|
|
85
86
|
refsForPaths.get(ref).push(`!${unixify(path)}`);
|
|
86
87
|
}
|
|
88
|
+
const maybeLeadingDotSlash = path.startsWith('./') ? './' : '';
|
|
87
89
|
const resolved = [];
|
|
88
90
|
for (const [ref, paths] of refsForPaths.entries()) {
|
|
89
|
-
resolved.push(...micromatch(readTreeAtRefSync(ref), paths).map(filePath => `git:${ref}:${filePath}`));
|
|
91
|
+
resolved.push(...micromatch(readTreeAtRefSync(ref), paths).map(filePath => `git:${ref}:${maybeLeadingDotSlash}${filePath}`));
|
|
90
92
|
}
|
|
91
93
|
return resolved;
|
|
92
94
|
}
|
|
@@ -177,7 +179,6 @@ export class GitLoader {
|
|
|
177
179
|
try {
|
|
178
180
|
if (isGlob(path)) {
|
|
179
181
|
const resolvedPaths = this.resolveGlobsSync(pointer, asArray(options.ignore || []));
|
|
180
|
-
const finalResult = [];
|
|
181
182
|
for (const path of resolvedPaths) {
|
|
182
183
|
if (this.canLoadSync(path)) {
|
|
183
184
|
const results = this.loadSync(path, options);
|