diff --git a/package.json b/package.json index 3becc9e..287cd17 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,9 @@ ], "author": "Unarray", "license": "MIT", + "dependencies": { + "ignore": "^5.2.4" + }, "devDependencies": { "@bluzzi/eslint-config": "^1.1.0", "@electron/remote": "^2.0.10", @@ -29,7 +32,7 @@ "obsidian": "latest", "tsconfig-paths": "^4.2.0", "tsup": "^7.2.0", - "typescript": "4.7.4" + "typescript": "5.2.2" }, "eslintConfig": { "extends": [ diff --git a/src/utils/filter/filter.ts b/src/utils/filter/filter.ts new file mode 100644 index 0000000..d54c5d0 --- /dev/null +++ b/src/utils/filter/filter.ts @@ -0,0 +1,5 @@ +import ignore from "ignore"; + +export const filter = (items: string[], patterns: string[]): string[] => { + return ignore().add(patterns).filter(items); +}; \ No newline at end of file diff --git a/src/utils/filter/index.ts b/src/utils/filter/index.ts new file mode 100644 index 0000000..e6bf852 --- /dev/null +++ b/src/utils/filter/index.ts @@ -0,0 +1 @@ +export * from "./filter"; \ No newline at end of file diff --git a/tsup.config.ts b/tsup.config.ts index 1e35de6..1479209 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -4,6 +4,9 @@ export default defineConfig((options) => ({ entry: { "main": "src/FileTreeGenerator.ts" }, + noExternal: [ + "ignore" + ], minify: !options.watch, format: "cjs", outDir: "./"