Function
countCommonObjectIs
(a: Array<unknown>, b: Array<unknown>)
Source from the content-addressed store, hash-verified
| 65 | |
| 66 | // Return length of longest common subsequence according to Object.is method. |
| 67 | const countCommonObjectIs = (a: Array<unknown>, b: Array<unknown>): number => { |
| 68 | let n = 0; |
| 69 | diff( |
| 70 | a.length, |
| 71 | b.length, |
| 72 | (aIndex: number, bIndex: number) => Object.is(a[aIndex], b[bIndex]), |
| 73 | (nCommon: number) => { |
| 74 | n += nCommon; |
| 75 | }, |
| 76 | ); |
| 77 | return n; |
| 78 | }; |
| 79 | |
| 80 | // Return length of longest common subsequence according to === operator. |
| 81 | const countCommonStrictEquality = ( |
Tested by
no test coverage detected