Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/chai/lib/chai/utils/flag.js>flag

BDD / TDD assertion framework for node.js and the browser that can be paired with any testing framework.
Latest
function flag
import { flag } from "https://deno.land/x/chai@v5.1.2/lib/chai/utils/flag.js";

.flag(object, key, [value])

Get or set a flag value on an object. If a value is provided it will be set, else it will return the currently set value or undefined if the value is not set.

utils.flag(this, 'foo', 'bar'); // setter
utils.flag(this, 'foo'); // getter, returns `bar`

Parameters

obj

object constructed Assertion

key
value

(optional)