1.3.0 • Published 11 months ago

fast-diff v1.3.0

Weekly downloads
6,117,207
License
Apache-2.0
Repository
github
Last release
11 months ago

Fast Diff Build Status

This is a simplified import of the excellent diff-match-patch library by Neil Fraser into the Node.js environment. The match and patch parts are removed, as well as all the extra diff options. What remains is incredibly fast diffing between two strings.

The diff function is an implementation of "An O(ND) Difference Algorithm and its Variations" (Myers, 1986) with the suggested divide and conquer strategy along with several optimizations Neil added.

var diff = require('fast-diff');

var good = 'Good dog';
var bad = 'Bad dog';

var result = diff(good, bad);
// [[-1, "Goo"], [1, "Ba"], [0, "d dog"]]

// Respect suggested edit location (cursor position), added in v1.1
diff('aaa', 'aaaa', 1)
// [[0, "a"], [1, "a"], [0, "aa"]]

// For convenience
diff.INSERT === 1;
diff.EQUAL === 0;
diff.DELETE === -1;
prettier-linter-helpers@huyhpham/rn-lineeasy-select-rnreact-native-bluetooth2@icanpm/api-master@oneplanetcrowd/developersreact-native-template-rfbaseairscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-module@moderno/workbenchdeneme323112@ntt_app/react-native-custom-notificationreact-native-covid-sdkquill-delta-tablegql_din_modrealtime-coremutasi-bca@jttechnic/interpreterquill-delta-withoutsmmysql-formatreact-native-printer-brothersreact-native-shekhar-bridge-testwilscanner@khalitovadel/abstract-repository@oiti/documentoscopy-react-nativequoc-testreact-native-slider-kf@infinitebrahmanuniverse/nolb-fast-plginexpand-react-bridgeluminos-ui-core@everything-registry/sub-chunk-1648jawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgp149-tablereact-native-jawwy_sampledesign-system-fitbank-450react-native-chenaarsilver-dockersemantic-release-gitmoji-actionscrypt-tsscrypt-ts-btcshadow-event-busshaf-unified-diffsimple-text-diffdskcorenewdualite-application-formduplicate-text-detectoref-h5es-react-bridgesolhint-nvimsolhintsolhint-cisolhint-communitystanikionereact-native-responsive-sizedemo-test-scrndiscord.js-bycondiscordjs-con-selfdogandev-simple-toast@damruravihara/react-native-testing-package@daiki48/keisanreat-native-multiplierkprrn_unique_device_idrouter-loggerrenamerresponsive-react-apprevaluatern-adyen-dropinrn-agora-ios-mrn-check-btnrn-circular-chartrichdocrn-counter-demorn-session-multiplier-demorn-tm-notifyrn-use-modal-hookec0lint-style-config-postcsssourcecrumbssmart_one_connectdiffupdate-webpack-pluginedit-ot-quill-deltac7@axeptio/eslint-config-axeptiocandlelabssdk@azalpacir/react-native-dhp-printer@aysea/react-native-ui-library@baolong281/gsplatcfb-cms-demo@bhzdbash/utils@behzadebrhm/utils@beldore/react-otp-input@bezael-challenge/innoit-date-format
1.3.0

11 months ago

1.2.0

6 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

8 years ago

1.0.1

9 years ago

1.0.0

10 years ago