diff --git a/src/generate.ts b/src/generate.ts index f002ab0..5683d13 100644 --- a/src/generate.ts +++ b/src/generate.ts @@ -1,6 +1,6 @@ import { emoji, characters, NodeTypes } from './config' -import { Options, TreeNode } from './type' import { blue } from 'picocolors' +import type { Options, TreeNode } from './type' const lastDirStack: boolean[] = [] diff --git a/src/handleOptions.ts b/src/handleOptions.ts index d685efe..c30907a 100644 --- a/src/handleOptions.ts +++ b/src/handleOptions.ts @@ -1,6 +1,6 @@ import fs from 'fs' -import { Options } from './type' import { fileExistSync } from './utils' +import type { Options } from './type' export const onExits: ((output: string) => void)[] = [] diff --git a/src/index.ts b/src/index.ts index 8ef59e4..f493bfb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,7 @@ import { toTree } from './toTree' import { generate } from './generate' import pkg from '../package.json' import { handleOptions, onExits } from './handleOptions' -import { Options } from './type' +import type { Options } from './type' program .name('treei') diff --git a/src/utils.ts b/src/utils.ts index bc2eb7d..277ac6a 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,5 @@ import fs from 'fs' -import { TreeNode } from './type' +import type { TreeNode } from './type' // check if a file or directory exists. export function fileExistSync(path: string) { diff --git a/test/toTree.spec.ts b/test/toTree.spec.ts index 01f1350..1627ff7 100644 --- a/test/toTree.spec.ts +++ b/test/toTree.spec.ts @@ -1,8 +1,8 @@ import { describe, test, expect } from 'vitest' import { toTree } from '../src/toTree' -import { Options } from '../src/type' import { NodeTypes } from '../src/config' import { getMaxLayer } from '../src/utils' +import type { Options } from '../src/type' describe('toTree', () => { const options: Options = {