mirror of
https://github.com/flarum/core.git
synced 2025-07-18 15:21:16 +02:00
docs: ItemList set methods throw errors when keys are not present
This commit is contained in:
@@ -127,7 +127,7 @@ export default class ItemList<T> {
|
|||||||
/**
|
/**
|
||||||
* Replaces an item's content, if the provided item key exists.
|
* 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 key The key of the item in the list
|
||||||
* @param content The item's new content
|
* @param content The item's new content
|
||||||
@@ -154,7 +154,7 @@ export default class ItemList<T> {
|
|||||||
/**
|
/**
|
||||||
* Replaces an item's priority, if the provided item key exists.
|
* 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 key The key of the item in the list
|
||||||
* @param priority The item's new priority
|
* @param priority The item's new priority
|
||||||
@@ -181,6 +181,8 @@ export default class ItemList<T> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove an item from the list.
|
* Remove an item from the list.
|
||||||
|
*
|
||||||
|
* If the provided `key` is not present, nothing will happen.
|
||||||
*/
|
*/
|
||||||
remove(key: string): this {
|
remove(key: string): this {
|
||||||
delete this._items[key];
|
delete this._items[key];
|
||||||
|
Reference in New Issue
Block a user