-
Notifications
You must be signed in to change notification settings - Fork 111
refactor: replace lodash.isequal with node:util.isDeepStrictEqual, #1606 #1809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 13 commits
c5d29aa
79b85f3
fc6013e
31e9fbb
e707939
3332cc9
e7a05e7
970ccff
097226c
f875303
4ef3173
8380912
53f5d6f
1ed7da8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -12,8 +12,7 @@ | |||||
| * @module | ||||||
| */ | ||||||
|
|
||||||
| import isEqual from 'lodash.isequal' | ||||||
| import { unreachable } from '../util' | ||||||
| import { isEqual, unreachable } from '../util' | ||||||
|
||||||
| import { isEqual, unreachable } from '../util' | |
| import { unreachable } from '../util' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And we also need to add an import for isDeepStrictEqual
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bugarela sorry... fix now.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,7 +88,7 @@ export function applySubstitution(subs: Substitutions, e: Effect): Either<ErrorT | |
| } | ||
|
|
||
| return result.map(simplify).chain(r => { | ||
| if (!isEqual(r, e)) { | ||
| if (!isDeepStrictEqual(r, e)) { | ||
|
||
| // Keep re-applying the substitutions until the effect is unchanged. | ||
| // Useful when substitutions have a transitive pattern [ a |-> b, b |-> c ] | ||
| return applySubstitution(subs, r) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,7 +92,7 @@ export function evalNondet( | |
| } | ||
|
|
||
| // Retry if condition is satisfied and we haven't exhausted all possible positions. | ||
| } while (shouldRetry && !isEqual(newPositions, originalPositions)) | ||
| } while (shouldRetry && !isDeepStrictEqual(newPositions, originalPositions)) | ||
|
||
|
|
||
| // Reset the cache | ||
| cache.value = undefined | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,7 +113,7 @@ export function applySubstitution(table: LookupTable, subs: Substitutions, t: Qu | |
| } | ||
|
|
||
| const result = singleApplication() | ||
| if (isEqual(result, t)) { | ||
| if (isDeepStrictEqual(result, t)) { | ||
|
||
| return t | ||
| } else { | ||
| return applySubstitution(table, subs, result) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,7 +56,7 @@ export function zip<A, B>(a: A[], b: B[]): [A, B][] { | |
| * | ||
| * ``` | ||
| * const result = findMap([1,2,3], (x) => x % 2 === 0 ? just(x) : none<int>()) | ||
| * lodash.isEqual(result, just(2)) | ||
| * lodash.isDeepStrictEqual(result, just(2)) | ||
|
||
| * ``` | ||
| * */ | ||
| export function findMap<X, Y>(xs: Iterable<X>, f: (x: X) => Maybe<Y>): Maybe<Y> { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not delete this file, it is necessary for building Quint with nix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yazaldefilimone can you add this file back please? We can't delete it.