* Sets the value of the cookie. * * @param {BytesValue} value - The value to be set. Must be an instance of BytesValue. * @returns {CookieFilter} - The updated CookieFilter instance for chaining. * @throws {Error} - If the value is not an instance of BytesValue.
(value)
| 43 | * @throws {Error} - If the value is not an instance of BytesValue. |
| 44 | */ |
| 45 | value(value) { |
| 46 | if (!(value instanceof BytesValue)) { |
| 47 | throw new Error(`Value must be an instance of BytesValue. Received:'${value}'`) |
| 48 | } |
| 49 | this.#map.set('value', Object.fromEntries(value.asMap())) |
| 50 | return this |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Sets the domain for the cookie. |