diff --git a/packages/collection/src/index.ts b/packages/collection/src/index.ts index 20d9fdf33..1ba5128b1 100644 --- a/packages/collection/src/index.ts +++ b/packages/collection/src/index.ts @@ -629,8 +629,8 @@ export class Collection extends Map { * * @param other The other Collection to filter against */ - public intersect(other: Collection) { - const coll = new this.constructor[Symbol.species](); + 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); } @@ -642,8 +642,8 @@ export class Collection extends Map { * * @param other The other Collection to filter against */ - public difference(other: Collection) { - const coll = new this.constructor[Symbol.species](); + public difference(other: Collection): Collection { + const coll = new this.constructor[Symbol.species](); for (const [k, v] of other) { if (!this.has(k)) coll.set(k, v); }