Lines 49-89javascript
50 const addPathNewPos = addPath.oldPos - diagonalPath;
51 canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
53 const canRemove = removePath && removePath.oldPos + 1 < oldLen;
54 if (!canAdd && !canRemove) {
55 bestPath[diagonalPath] = void 0;
58 if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) basePath = this.addToPath(addPath, true, false, 0, options);
59 else basePath = this.addToPath(removePath, false, true, 1, options);
60 newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options);
61 if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) return done(this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true;
63 bestPath[diagonalPath] = basePath;
64 if (basePath.oldPos + 1 >= oldLen) maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
65 if (newPos + 1 >= newLen) minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
70 if (callback) (function exec() {
71 setTimeout(function() {
HighChild Process
Package source references child process execution.
dist/chunk-CBJVD2XA-DladBQ9O.cjsView on unpkg · L69 72 if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) return callback(void 0);
73 if (!execEditLength()) exec();
76 else while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
77 const ret = execEditLength();
81 addToPath(path, added, removed, oldPosInc, options) {
82 const last = path.lastComponent;
83 if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) return {
84 oldPos: path.oldPos + oldPosInc,
86 count: last.count + 1,
89 previousComponent: last.previousComponent