js-code-detector 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -113,8 +113,12 @@ function generateReport(jsonStr) {
113
113
  }
114
114
  async function sameCodeDetect(dirOfCwd) {
115
115
  const filesAndContent = await (0, import_readDirFiles.readSrcFiles)(dirOfCwd);
116
- const { nodeContentGroupList } = import_Core.default.investigate(filesAndContent);
117
- const md = import_Core.default.createMarkdownFile(nodeContentGroupList.slice(0, 5));
116
+ const { nodeContentGroupList, depthList } = import_Core.default.investigate(filesAndContent);
117
+ let validDepthList = depthList.filter((e) => e > 3);
118
+ if (validDepthList.length === 0) {
119
+ validDepthList = depthList.slice(0, 1);
120
+ }
121
+ const md = import_Core.default.createMarkdownFile(nodeContentGroupList.filter((e) => validDepthList.includes(e.depth)).slice(0, 5));
118
122
  (0, import_fs2.writeFileSync)((0, import_path.join)(process.cwd(), `${(0, import_dayjs.default)().format("YYYYMDD_HHmm")}_same_code.md`), md, { encoding: "utf-8", flag: "w" });
119
123
  }
120
124
  // Annotate the CommonJS export names for ESM import in node:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-code-detector",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",