From e45547c6491295f57d24aceacbd30559245a95f6 Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Fri, 20 May 2022 17:38:25 +0100 Subject: [PATCH] docs: ItemList set methods throw errors when keys are not present --- framework/core/js/src/common/utils/ItemList.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/core/js/src/common/utils/ItemList.ts b/framework/core/js/src/common/utils/ItemList.ts index 79b58a5bb..a18819d21 100644 --- a/framework/core/js/src/common/utils/ItemList.ts +++ b/framework/core/js/src/common/utils/ItemList.ts @@ -127,7 +127,7 @@ export default class ItemList { /** * Replaces an item's content, if the provided item key exists. * - * If the provided `key` is not present, nothing will happen. + * If the provided `key` is not present, an error will be thrown. * * @param key The key of the item in the list * @param content The item's new content @@ -154,7 +154,7 @@ export default class ItemList { /** * Replaces an item's priority, if the provided item key exists. * - * If the provided `key` is not present, nothing will happen. + * If the provided `key` is not present, an error will be thrown. * * @param key The key of the item in the list * @param priority The item's new priority @@ -181,6 +181,8 @@ export default class ItemList { /** * Remove an item from the list. + * + * If the provided `key` is not present, nothing will happen. */ remove(key: string): this { delete this._items[key];