X-Git-Url: https://git.ladys.computer/Etiquette/blobdiff_plain/e3a2a78fdfb9d913f311ff1948038dfbcb758a05..998a27ffd305bdbef26b0f864924660e575e6e44:/model.js diff --git a/model.js b/model.js index 76bf615..6963a16 100644 --- a/model.js +++ b/model.js @@ -385,7 +385,10 @@ class Tag { }); } - /** Adds the provided label(s) to this `Tag` as alternate labels. */ + /** + * Adds the provided label(s) to this `Tag` as alternate labels, then + * returns this `Tag`. + */ addAltLabel(...labels) { const altLabels = this.#data.altLabel; let objectLabels = null; // initialized on first use @@ -428,11 +431,12 @@ class Tag { altLabels.add(literal); } } + return this; } /** * Adds the provided tags to the list of tags that this `Tag` is - * narrower than. + * narrower than, then returns this `Tag`. * * Arguments may be string identifiers or objects with an * `.identifier` property. @@ -474,9 +478,13 @@ class Tag { } } } + return this; } - /** Adds the provided label(s) to this `Tag` as hidden labels. */ + /** + * Adds the provided label(s) to this `Tag` as hidden labels, then + * returns this `Tag`. + */ addHiddenLabel(...labels) { const hiddenLabels = this.#data.hiddenLabel; let objectLabels = null; // initialized on first use @@ -519,11 +527,12 @@ class Tag { hiddenLabels.add(literal); } } + return this; } /** * Adds the provided tags to the list of tags that this `Tag` is in - * canon with. + * canon with, then returns this `Tag`. * * Arguments may be string identifiers or objects with an * `.identifier` property. @@ -584,11 +593,12 @@ class Tag { } } } + return this; } /** * Adds the provided tags to the list of tags that this `Tag` - * involves. + * involves, then returns this `Tag`. * * Arguments may be string identifiers or objects with an * `.identifier` property. @@ -650,6 +660,7 @@ class Tag { } } } + return this; } /** Yields the alternative labels of this `Tag`. */ @@ -726,7 +737,7 @@ class Tag { /** * Removes the provided string label(s) from this `Tag` as alternate - * labels. + * labels, then returns this `Tag`. */ deleteAltLabel(...labels) { const altLabels = this.#data.altLabel; @@ -761,11 +772,12 @@ class Tag { altLabels.delete(literal); } } + return this; } /** * Removes the provided tags from the list of tags that this `Tag` is - * narrower than. + * narrower than, then returns this `Tag`. * * Arguments may be string identifiers or objects with an * `.identifier` property. @@ -776,11 +788,12 @@ class Tag { // Iterate over the provided tags and delete them. broader.delete(toIdentifier($)); } + return this; } /** * Removes the provided string label(s) from this `Tag` as hidden - * labels. + * labels, then returns this `Tag`. */ deleteHiddenLabel(...labels) { const hiddenLabels = this.#data.hiddenLabel; @@ -815,11 +828,12 @@ class Tag { hiddenLabels.delete(literal); } } + return this; } /** * Removes the provided tags from the list of tags that this `Tag` is - * in canon with. + * in canon with, then returns this `Tag`. * * Arguments may be string identifiers or objects with an * `.identifier` property. @@ -830,11 +844,12 @@ class Tag { // Iterate over the provided tags and delete them. inCanon.delete(toIdentifier($)); } + return this; } /** * Removes the provided tags from the list of tags that this `Tag` - * involves. + * involves, then returns this `Tag`. * * Arguments may be string identifiers or objects with an * `.identifier` property. @@ -845,6 +860,7 @@ class Tag { // Iterate over the provided tags and delete them. involves.delete(toIdentifier($)); } + return this; } /** Yields `Tag`s that are in canon of this `Tag`. */