Skip to content

Commit 6f1a269

Browse files
authored
Unify comments in README with TS comments (#76)
1 parent 6cdf98b commit 6f1a269

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@ verifying the equality of larger strings or data structures in tests.
1616
```javascript
1717
import * as assertNoDiff from "assert-no-diff"
1818

19-
// assert no differences between two JavaScript objects
19+
// Diffs two JSON objects, comparing the fields defined on each.
20+
// The order of fields does not matter.
2021
assertNoDiff.json(actualJson, expectedJson)
2122

22-
// compare strings and highlight the differences character-by-character
23+
// Asserts that two blocks of text are equal, comparing character by character.
2324
assertNoDiff.chars(actualString, expectedString)
2425

25-
// compare strings and highlight the mismatching words, whitespace-sensitive
26+
// Diffs two blocks of text, comparing word by word.
27+
// Whitespace is significant.
2628
assertNoDiff.wordsWithSpace(actualString, expectedString)
2729

28-
// compare strings and highlight the mismatching lines, ignoring whitespace around them
30+
// Diffs two blocks of text, comparing line by line.
31+
// Ignores leading and trailing whitespace.
2932
assertNoDiff.trimmedLines(actualString, expectedString)
3033
```
3134

src/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function chars(
2525

2626
/**
2727
* Diffs two JSON objects, comparing the fields defined on each.
28-
* The order of fields, etc does not matter.
28+
* The order of fields does not matter.
2929
*
3030
* @throws a bash-colored error if the arguments are not equal
3131
*/
@@ -47,7 +47,8 @@ export function json(
4747
}
4848

4949
/**
50-
* Diffs two blocks of text, comparing line by line, ignoring leading and trailing whitespace.
50+
* Diffs two blocks of text, comparing line by line.
51+
* Ignores leading and trailing whitespace.
5152
*
5253
* @throws a bash-colored error if the arguments are not equal
5354
*/
@@ -69,7 +70,8 @@ export function trimmedLines(
6970
}
7071

7172
/**
72-
* Diffs two blocks of text, comparing word by word, treating whitespace as significant.
73+
* Diffs two blocks of text, comparing word by word.
74+
* Whitespace is significant.
7375
*
7476
* @throws a bash-colored error if the arguments are not equal
7577
*/

0 commit comments

Comments
 (0)