Skip to content

Commit

Permalink
Add type check
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Mar 5, 2024
1 parent 762ab0f commit 1012237
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions denops/ddc/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
basename,
Denops,
fn,
is,
Lock,
op,
parse,
Expand Down Expand Up @@ -189,15 +190,18 @@ async function globpath(
1,
);

for (const path of glob) {
// Skip already added name.
const parsed = parse(path);
const key = `${basename(parsed.dir)}/${parsed.name}`;
if (key in paths) {
continue;
if (is.Array(glob)) {
// NOTE: glob may be invalid.
for (const path of glob) {
// Skip already added name.
const parsed = parse(path);
const key = `${basename(parsed.dir)}/${parsed.name}`;
if (key in paths) {
continue;
}

paths[key] = path;
}

paths[key] = path;
}

return paths;
Expand Down

0 comments on commit 1012237

Please sign in to comment.