express-fix-any-js 1.3.2 → 1.3.3
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.
|
@@ -5,14 +5,6 @@ import writeFile from "../writeFile.js";
|
|
|
5
5
|
|
|
6
6
|
import buildUpdatedContent from "./buildUpdatedContent.js";
|
|
7
7
|
|
|
8
|
-
const validateDuplicate = ({ content, jsFilePath, duplicationCheck }) => {
|
|
9
|
-
return checkDuplicate({
|
|
10
|
-
inContent: content,
|
|
11
|
-
inFilePath: jsFilePath,
|
|
12
|
-
inSearchText: duplicationCheck
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
|
|
16
8
|
const locateInsertPoint = ({ content, insertAfter }) => {
|
|
17
9
|
return findInsertIndex({
|
|
18
10
|
inContent: content,
|
|
@@ -29,7 +21,21 @@ const alterFile = ({
|
|
|
29
21
|
}) => {
|
|
30
22
|
const content = readFile(jsFilePath);
|
|
31
23
|
|
|
32
|
-
const duplicateInfo =
|
|
24
|
+
const duplicateInfo = checkDuplicate({
|
|
25
|
+
inContent: content,
|
|
26
|
+
inFilePath: jsFilePath,
|
|
27
|
+
inSearchText: duplicationCheck
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
if (duplicateInfo.found) {
|
|
31
|
+
if (showLog) {
|
|
32
|
+
console.log(
|
|
33
|
+
`Duplicate found at line ${duplicateInfo.lineNumber}`
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return duplicateInfo;
|
|
38
|
+
};
|
|
33
39
|
|
|
34
40
|
// const index = locateInsertPoint({ content, importInsertAfter });
|
|
35
41
|
const insertInfo = locateInsertPoint({
|