From 9a95d28dce26f72669999c7d2faf33d156d034f7 Mon Sep 17 00:00:00 2001 From: "abdulelhakim68@gmail.com" Date: Tue, 23 Jan 2024 14:41:32 +0700 Subject: [PATCH] update --- src/list.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/list.ts b/src/list.ts index f70b483..80a6889 100644 --- a/src/list.ts +++ b/src/list.ts @@ -151,6 +151,7 @@ export class List implements AbstractList { : never) | undefined, ): boolean | (T extends any ? T : never) | undefined { + // if ``after`` argument given, doing some computation befoere inserting. if (after) { const foundAfter = this.find((el) => this.isEquals(el, after as T)); const afterId = this._context.indexOf(foundAfter as T); @@ -160,9 +161,8 @@ export class List implements AbstractList { return true; } - // // if after element is not pases otherwise append them at the last + // other wise just append that element at the end of list and check again that record is found then return as booleans this.append(element); - // // check again that record is fond and return as booleans const aftterInsert = this.find((e) => this.isEquals(e, element)); return !!aftterInsert; }