mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-23 02:10:12 +01:00
632ae0b7c3
* Prevent new JS files in shared folder * migrate to typescript * fix types * cleanup
41 lines
764 B
TypeScript
41 lines
764 B
TypeScript
const generateCreateFileDiff = (
|
|
filePath = 'file.txt',
|
|
content = 'Lorem ipsum',
|
|
): string => `
|
|
diff --git a/${filePath} b/${filePath}
|
|
new file mode 100644
|
|
index 000000000..30d74d258
|
|
--- /dev/null
|
|
+++ b/${filePath}
|
|
@@ -0,0 +1 @@
|
|
+${content}
|
|
`;
|
|
|
|
const generateModifyFilesDiff = (
|
|
filePath = 'file.txt',
|
|
addition = 'Lorem ipsum',
|
|
removal = '',
|
|
): string => {
|
|
const additionBlock = addition
|
|
? `
|
|
@@ -1,3 +1,8 @@
|
|
+${addition}`.trim()
|
|
: '';
|
|
|
|
const removalBlock = removal
|
|
? `
|
|
@@ -34,33 +39,4 @@
|
|
-${removal}`.trim()
|
|
: '';
|
|
|
|
return `
|
|
diff --git a/${filePath} b/${filePath}
|
|
index 57d5de75c..808d8ba37 100644
|
|
--- a/${filePath}
|
|
+++ b/${filePath}
|
|
${additionBlock}
|
|
${removalBlock}`;
|
|
};
|
|
|
|
export { generateCreateFileDiff, generateModifyFilesDiff };
|