From 12667f6b66bbe3b0babf9fe09a6d106edf2873db Mon Sep 17 00:00:00 2001 From: Wenchen Li <9028430+neo@users.noreply.github.com> Date: Mon, 19 Sep 2022 18:19:41 -0400 Subject: [PATCH] Remove unused return in `forEach` of `YMap` If the idea is to keep the API as close to the JS Map as possible, maybe we should consider not returning here. Ref: https://github.com/microsoft/TypeScript/blob/v4.8.3/lib/lib.es2015.collection.d.ts#L28-L31 --- src/types/YMap.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/types/YMap.js b/src/types/YMap.js index f103026e..a31b9e03 100644 --- a/src/types/YMap.js +++ b/src/types/YMap.js @@ -167,16 +167,11 @@ export class YMap extends AbstractType { * @param {function(MapType,string,YMap):void} f A function to execute on every element of this YArray. */ forEach (f) { - /** - * @type {Object} - */ - const map = {} this._map.forEach((item, key) => { if (!item.deleted) { f(item.content.getContent()[item.length - 1], key, this) } }) - return map } /**