Skip to content

Commit 51742b8

Browse files
Trotttargos
authored andcommitted
doc: revise assert legacy mode text
Revise the text for the `assert` module's legacy mode to make it simpler and more scannable. PR-URL: #28315 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent b448db3 commit 51742b8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

doc/api/assert.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,21 @@ Please note that this will also deactivate the colors in the REPL.
121121

122122
> Stability: 0 - Deprecated: Use strict mode instead.
123123
124-
When accessing `assert` directly instead of using the `strict` property, the
125-
[Abstract Equality Comparison][] will be used for any function without "strict"
126-
in its name, such as [`assert.deepEqual()`][].
124+
Legacy mode uses the [Abstract Equality Comparison][] in:
127125

128-
It can be accessed using:
126+
* [`assert.deepEqual()`][]
127+
* [`assert.equal()`][]
128+
* [`assert.notDeepEqual()`][]
129+
* [`assert.notEqual()`][]
130+
131+
To use legacy mode:
129132

130133
```js
131134
const assert = require('assert');
132135
```
133136

134-
It is recommended to use the [`strict` mode][] instead as the
135-
[Abstract Equality Comparison][] can often have surprising results. This is
137+
Whenever possible, use the [`strict` mode][] instead. Otherwise, the
138+
[Abstract Equality Comparison][] may cause surprising results. This is
136139
especially true for [`assert.deepEqual()`][], where the comparison rules are
137140
lax:
138141

0 commit comments

Comments
 (0)