Closed kt3k closed 17 hours ago
This change makes imports shorter and less repetitive, but on the other hand it breaks the pattern of every module being named after the symbol it exports, and having two similarly named modules (equal
and equals
) might cause confusion.
How about renaming equal
to isEqual
to avoid the above (possible) confusion?
A question has been raised in #5176
Should we also do the rename of @std/assert/assertion-error
-> @std/assert/error
?
Should we also do the rename of @std/assert/assertion-error -> @std/assert/error?
I personally don't think we should do this rename.
assert/equals
and assertEquals
have completely the same sound when they are read. So it feels natural to be able to import assertEquals
from assert/equals
. On the other hand, assert/error
and AssertionError
are different in sound. So it feels a bit confusing that one can import AssertionError
from assert/error
.
WDYT?
It makes sense that @std/assert/error
exports an error class, and it doesn't stick out as much as having a @std/assert/assertion-error
, compared to the rest of the package. That's as deep as my reasoning goes, but my opinion isn't too strong.
The core team proposes the change to the entrypoint pattern in
@std/assert
like the below: