-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
139 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { CompareFileHandler } from './types'; | ||
|
||
|
||
export interface FileCompareHandlers { | ||
/** | ||
* Default file content comparison handlers, used if [[Options.compareFileAsync]] or [[Options.compareFileSync]] are not specified. | ||
* | ||
* Performs binary comparison. | ||
*/ | ||
defaultFileCompare: CompareFileHandler; | ||
/** | ||
* Compares files line by line. | ||
* | ||
* Options: | ||
* * ignoreLineEnding - true/false (default: false) - Ignore cr/lf line endings | ||
* * ignoreWhiteSpaces - true/false (default: false) - Ignore white spaces at the beginning and ending of a line (similar to 'diff -b') | ||
* * ignoreAllWhiteSpaces - true/false (default: false) - Ignore all white space differences (similar to 'diff -w') | ||
* * ignoreEmptyLines - true/false (default: false) - Ignores differences caused by empty lines (similar to 'diff -B') | ||
*/ | ||
lineBasedFileCompare: CompareFileHandler; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import compareSync from './compareSync' | ||
import compareAsync from './compareAsync' | ||
|
||
|
||
import {lineBasedCompareSync} from './compareSync' | ||
import {lineBasedCompareAsync} from './compareAsync' | ||
import { CompareFileHandler } from '../../types' | ||
|
||
/** | ||
* Compare files line by line with options to ignore | ||
* line endings and white space differences. | ||
*/ | ||
export default { | ||
compareSync, compareAsync | ||
export const lineBasedFileCompare: CompareFileHandler = { | ||
compareSync: lineBasedCompareSync, | ||
compareAsync: lineBasedCompareAsync | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters