Skip to content

Commit

Permalink
Add utils.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Jun 18, 2023
1 parent 11effa0 commit 0658fe0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 1 addition & 4 deletions denops/ddu/ddu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import { defaultColumnOptions } from "./base/column.ts";
import { defaultKindOptions } from "./base/kind.ts";
import { defaultActionOptions } from "./base/action.ts";
import { Loader } from "./loader.ts";
import { treePath2Filename } from "./utils.ts";

type GatherState = {
items: DduItem[];
Expand Down Expand Up @@ -2078,10 +2079,6 @@ function convertTreePath(treePath: TreePath) {
return typeof treePath === "string" ? treePath.split(pathsep) : treePath;
}

function treePath2Filename(treePath: TreePath) {
return typeof treePath === "string" ? treePath : treePath.join(pathsep);
}

function isParentPath(checkPath: string[], searchPath: string[]) {
return checkPath !== searchPath &&
searchPath.join(pathsep).startsWith(checkPath.join(pathsep) + pathsep);
Expand Down
6 changes: 6 additions & 0 deletions denops/ddu/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { pathsep } from "./deps.ts";
import { TreePath } from "./types.ts";

export function treePath2Filename(treePath: TreePath) {
return typeof treePath === "string" ? treePath : treePath.join(pathsep);
}

0 comments on commit 0658fe0

Please sign in to comment.