Conversation
## Because - `deep-equal` is a third-party package that does what Node's `util.isDeepStrictEqual` already does. - The customs server is the only package that pins it, so replacing the two call sites drops the dependency. ## This pull request - Replaces `deep-equal` with `util.isDeepStrictEqual` in `limits.js` and `requestChecks.js`. - Removes `deep-equal` from `packages/fxa-customs-server/package.json` and updates `yarn.lock`. ## Issue that this pull request solves Closes: https://mozilla-hub.atlassian.net/browse/FXA-13931
Contributor
There was a problem hiding this comment.
Pull request overview
Replaces the customs server’s third-party deep comparison utility with Node’s built-in equivalent.
Changes:
- Uses
util.isDeepStrictEqualat both comparison sites. - Removes
deep-equaland its obsolete lockfile entries.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
limits.js |
Uses Node’s strict deep comparison. |
requestChecks.js |
Uses Node’s strict deep comparison. |
package.json |
Removes the direct dependency. |
yarn.lock |
Removes obsolete dependency entries. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
toufali
approved these changes
Aug 14, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because
deep-equalis a third-party package that does what Node'sutil.isDeepStrictEqualalready does.This pull request
deep-equalwithutil.isDeepStrictEqualinlimits.jsandrequestChecks.js.deep-equalfrompackages/fxa-customs-server/package.jsonand updatesyarn.lock.Issue that this pull request solves
Closes: https://mozilla-hub.atlassian.net/browse/FXA-13931
Checklist
Put an
xin the boxes that applyHow to review (Optional)
lib/settings/limits.jsandlib/settings/requestChecks.js, four changed lines between them.package.jsonandyarn.lock.Screenshots (Optional)
Other information (Optional)
deep-equalcompares loosely by default andisDeepStrictEqualis strict, so the case to worry about is1vs'1'. Two things make the swap safe:else ifof atypeof current !== typeof futureguard. A top-level1vs'1'takes the first branch and never reaches the comparison.else ifbody only callslog.info. Nothing is assigned, returned, or thrown, so where strict and loose disagree the effect is one log line.One caveat worth stating: for objects and arrays,
typeofis'object'on both sides, so a nested1vs'1'does reach the comparison and could log differently. Still only a log line.Verification:
test/local/settings_tests.jscovers both call sites and passes locally, 30 assertions.npx nx lint fxa-customs-serveris clean. No tests needed changing, which is why that box is unchecked.