Skip to content
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

Migrate diff-sequences to Typescript #7820

Merged
merged 3 commits into from Feb 6, 2019

Conversation

lorenzorapetti
Copy link
Contributor

Summary

Diff in built code:

diff --git a/packages/diff-sequences/build/index.js b/packages/diff-sequences/build/index.js
index a85f0a1ed..7c696426a 100644
--- a/packages/diff-sequences/build/index.js
+++ b/packages/diff-sequences/build/index.js
@@ -11,7 +11,6 @@ exports.default = void 0;
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
  *
- *
  */
 // This diff-sequences package implements the linear space variation in
 // An O(ND) Difference Algorithm and Its Variations by Eugene W. Myers
@@ -603,13 +602,33 @@ const findSubsequences = (
     if (transposed && callbacks.length === 1) {
       // Lazily wrap callback functions to swap args if graph is transposed.
       const _callbacks$ = callbacks[0],
-        _foundSubsequence = _callbacks$.foundSubsequence,
-        _isCommon = _callbacks$.isCommon;
+        foundSubsequence = _callbacks$.foundSubsequence,
+        isCommon = _callbacks$.isCommon;
       callbacks[1] = {
-        foundSubsequence: (nCommon, bCommon, aCommon) => {
-          _foundSubsequence(nCommon, aCommon, bCommon);
-        },
-        isCommon: (bIndex, aIndex) => _isCommon(aIndex, bIndex)
+        foundSubsequence: (function(_foundSubsequence) {
+          function foundSubsequence(_x, _x2, _x3) {
+            return _foundSubsequence.apply(this, arguments);
+          }
+
+          foundSubsequence.toString = function() {
+            return _foundSubsequence.toString();
+          };
+
+          return foundSubsequence;
+        })((nCommon, bCommon, aCommon) => {
+          foundSubsequence(nCommon, aCommon, bCommon);
+        }),
+        isCommon: (function(_isCommon) {
+          function isCommon(_x4, _x5) {
+            return _isCommon.apply(this, arguments);
+          }
+
+          isCommon.toString = function() {
+            return _isCommon.toString();
+          };
+
+          return isCommon;
+        })((bIndex, aIndex) => isCommon(aIndex, bIndex))
       };
     }

Test plan

Green CI

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@thymikee
Copy link
Collaborator

thymikee commented Feb 6, 2019

Interesting how complicated the build got compared to the baseline

@SimenB SimenB merged commit e8f5d62 into jestjs:master Feb 6, 2019
@SimenB
Copy link
Member

SimenB commented Feb 6, 2019

Yeah, seems like it wants to make sure this stays correct in the new version? Not sure why

@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants