File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 11# react-native-bs-diff-patch
22
3- rn bs diff patch
3+ rn bs diff patch file
44
55## Installation
66
@@ -11,11 +11,17 @@ npm install react-native-bs-diff-patch
1111## Usage
1212
1313``` js
14- import { multiply } from ' react-native-bs-diff-patch' ;
14+ import { diff , patch } from ' react-native-bs-diff-patch' ;
1515
1616// ...
1717
18- const result = await multiply (3 , 7 );
18+ /**
19+ * generate patch file from old file and new file
20+ */
21+ await diff (oldFile, newFile, patchFile);
22+ // generate new file from old file and patch file
23+ await patch (oldFile, newFile, patchFile);
24+
1925```
2026
2127## Contributing
Original file line number Diff line number Diff line change @@ -17,6 +17,12 @@ const BsDiffPatch = NativeModules.BsDiffPatch
1717 }
1818 ) ;
1919
20+ /**
21+ * generate new file from old file and patch file
22+ * @param oldFile orignal file path
23+ * @param newFile new file path
24+ * @param patchFile patch file path
25+ **/
2026export function patch (
2127 oldFile : string ,
2228 newFile : string ,
@@ -25,6 +31,13 @@ export function patch(
2531 return BsDiffPatch . patch ( oldFile , newFile , patchFile ) ;
2632}
2733
34+ /**
35+ * generate patch file from old file and new file
36+ * @param oldFile orignal file path
37+ * @param newFile new file path
38+ * @param patchFile patch file path
39+ * @returns
40+ */
2841export function diff (
2942 oldFile : string ,
3043 newFile : string ,
You can’t perform that action at this time.
0 commit comments