mirror of
https://github.com/r0adkll/sign-android-release
synced 2026-09-25 22:28:37 +00:00
bump jest and make tests pass
This commit is contained in:
+5
-7
@@ -28,15 +28,14 @@ To add this package as a dependency of a project, do either of the following:
|
||||
|
||||
To use `diff` as the name of the default export from this package, do either of the following:
|
||||
|
||||
- `var diff = require('diff-sequences'); // CommonJS modules`
|
||||
- `var diff = require('diff-sequences').default; // CommonJS modules`
|
||||
- `import diff from 'diff-sequences'; // ECMAScript modules`
|
||||
|
||||
Call `diff` with the **lengths** of sequences and your **callback** functions:
|
||||
|
||||
```js
|
||||
/* eslint-disable no-var */
|
||||
var a = ['a', 'b', 'c', 'a', 'b', 'b', 'a'];
|
||||
var b = ['c', 'b', 'a', 'b', 'a', 'c'];
|
||||
const a = ['a', 'b', 'c', 'a', 'b', 'b', 'a'];
|
||||
const b = ['c', 'b', 'a', 'b', 'a', 'c'];
|
||||
|
||||
function isCommon(aIndex, bIndex) {
|
||||
return a[aIndex] === b[bIndex];
|
||||
@@ -73,10 +72,9 @@ Various packages which implement the Myers algorithm will **always agree** on th
|
||||
## Example of callback functions to count common items
|
||||
|
||||
```js
|
||||
/* eslint-disable no-var */
|
||||
// Return length of longest common subsequence according to === operator.
|
||||
function countCommonItems(a, b) {
|
||||
var n = 0;
|
||||
let n = 0;
|
||||
function isCommon(aIndex, bIndex) {
|
||||
return a[aIndex] === b[bIndex];
|
||||
}
|
||||
@@ -89,7 +87,7 @@ function countCommonItems(a, b) {
|
||||
return n;
|
||||
}
|
||||
|
||||
var commonLength = countCommonItems(
|
||||
const commonLength = countCommonItems(
|
||||
['a', 'b', 'c', 'a', 'b', 'b', 'a'],
|
||||
['c', 'b', 'a', 'b', 'a', 'c'],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user