Skip to content

Commit 1f2b8c8

Browse files
Trotttargos
authored andcommitted
doc: revise strict mode text in assert
Revise the text describing `strict` mode. PR-URL: #28285 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent c4a357d commit 1f2b8c8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

doc/api/assert.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
The `assert` module provides a set of assertion functions for verifying
88
invariants. The module provides a recommended [`strict` mode][] and a more
9-
lenient `legacy` mode.
9+
lenient legacy mode.
1010

1111
For more information about the used equality comparisons see
1212
[MDN's guide on equality comparisons and sameness][mdn-equality-guide].
@@ -80,14 +80,14 @@ changes:
8080
description: Added strict mode to the assert module.
8181
-->
8282

83-
When using the `strict` mode, any `assert` function will use the equality used
84-
in the strict function mode. So [`assert.deepEqual()`][] will, for example,
85-
work the same as [`assert.deepStrictEqual()`][].
83+
In `strict` mode, `assert` functions use the comparison in the corresponding
84+
strict functions. For example, [`assert.deepEqual()`][] will behave like
85+
[`assert.deepStrictEqual()`][].
8686

87-
On top of that, error messages which involve objects produce an error diff
88-
instead of displaying both objects. That is not the case for the legacy mode.
87+
In `strict` mode, error messages for objects display a diff. In legacy mode,
88+
error messages for objects display the objects, often truncated.
8989

90-
It can be accessed using:
90+
To use `strict` mode:
9191

9292
```js
9393
const assert = require('assert').strict;

0 commit comments

Comments
 (0)