-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Add diff-sequences package #5407
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5407 +/- ##
=======================================
Coverage 61.35% 61.35%
=======================================
Files 205 205
Lines 6925 6925
Branches 4 3 -1
=======================================
Hits 4249 4249
Misses 2675 2675
Partials 1 1 Continue to review full report at Codecov.
|
Residue:
|
[EDIT: No need to export types of input and output callback functions, because type of default export includes its args, true?] For other projects to type check this package as a dependency means that it will need definitions in flow-typed and definitely-typed? |
This is a huge diff but it looks really really good.
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This generic package has specific goals for
jest-diff
in a future pull request:--expand
and--no-expand
options.Here are recommended steps to review this pull request:
Read
README.md
especially the examples of callback functionsRefer to An O(ND) Difference Algorithm and Its Variations by Eugene W. Myers
Read tests in
index.test.js
The first time you read code in
index.js
skip the two Overlappable functionsOverview of cost:
time and space optimization: skip diagonals in which paths cannot ever overlap
heap used is two arrays of small integers: each has max length of one more than length of shorter sequence
stack depth is at most logarithm of number of differences [EDIT optimization: does not recurse whenever number of changes is equal to number of items in either half of divided interval, therefore cannot contain any common items]
Test plan
44 tests [EDIT: plus 4 and forgot to say 100% coverage]