]> Lady’s Gitweb - Etiquette/blobdiff - model.js
Return this on Tag add/delete methods
[Etiquette] / model.js
index 76bf615bc2aaf4a5318af3cd75ec40bde4be7894..6963a16778601567b5d56bef31763af503eeeba1 100644 (file)
--- 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`. */
This page took 0.055353 seconds and 4 git commands to generate.