MCPcopy
hub / github.com/jestjs/jest / countCommonObjectIs

Function countCommonObjectIs

packages/diff-sequences/src/__tests__/index.test.ts:67–78  ·  view source on GitHub ↗
(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.
67const 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.
81const countCommonStrictEquality = (

Callers 1

index.test.tsFile · 0.85

Calls 1

diffFunction · 0.50

Tested by

no test coverage detected