diff --git a/packages/collection/src/index.ts b/packages/collection/src/index.ts index 1ba5128b1..ed266aebd 100644 --- a/packages/collection/src/index.ts +++ b/packages/collection/src/index.ts @@ -625,14 +625,16 @@ export class Collection extends Map { } /** - * The intersect method returns a new structure containing items where the keys are present in both original structures. + * The intersect method returns a new structure containing items where the keys and values are present in both original structures. * * @param other The other Collection to filter against */ public intersect(other: Collection): Collection { const coll = new this.constructor[Symbol.species](); for (const [k, v] of other) { - if (this.has(k)) coll.set(k, v); + if (this.has(k) && Object.is(v, this.get(k))) { + coll.set(k, v); + } } return coll; }