Skip to content

Commit

Permalink
chore: dep update
Browse files Browse the repository at this point in the history
  • Loading branch information
Soontao committed Nov 16, 2022
1 parent 3e0eb4f commit 1ca97b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
25 changes: 5 additions & 20 deletions src/file.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
import { Extension, ScanResult, ReportVO, PackageJson, FileImportDescription } from "./type";
import { concat, filter, isArray, isString, join as arrayJoin, keys, map } from "@newdash/newdash";
import { includes } from "@newdash/newdash/includes";
import { readFileSync } from "fs";
import { sync } from "glob";
import { join as pathJoin, dirname, join, normalize, relative } from "path";
import { join as arrayJoin, map, isArray, isString, concat, filter, keys } from "@newdash/newdash";
import { includes } from "@newdash/newdash/includes"
import { readFileSync, writeFileSync, existsSync } from "fs";
import { dirname, join, join as pathJoin, normalize, relative } from "path";
import { cwd } from "process";
import { tmpdir, platform } from "os";
import { exec } from "child_process";
import { Extension, FileImportDescription, PackageJson, ReportVO, ScanResult } from "./type";

require.extensions[".ts"] = require.extensions[".js"]
require.extensions[".jsx"] = require.extensions[".js"]
require.extensions[".tsx"] = require.extensions[".js"]
require.extensions[".mjs"] = require.extensions[".js"]

const extensions = [
"js", "jsx", "ts", "tsx", "mjs"
]

const { resolve } = require

export const allDependencies = (absPath: string) => {
Expand Down Expand Up @@ -120,12 +114,3 @@ export const mapScanResultToReportVO = (result: ScanResult): ReportVO => {
return rt;
}

export const writeFileToTmpDirAndOpenIt = (filename: string, content: string) => {
const path = join(tmpdir(), filename);
writeFileSync(path, content);
if (platform() === "win32") {
exec(`start ${path}`)
} else {
exec(`open ${path}`)
}
}
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@

export { scanDirectoryWithResult } from "./scanner"

export { writeFileToTmpDirAndOpenIt } from "./file"

export { calculateCycleImport } from "./graph"

0 comments on commit 1ca97b5

Please # to comment.