Sha256: f94422e1bd21d661c0827fc4fd75aebdaeda9aa8c13f57383b1ea7d500c8c5ce
Contents?: true
Size: 836 Bytes
Versions: 26
Compression:
Stored size: 836 Bytes
Contents
/*! * Chai - flag utility * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com> * MIT Licensed */ /** * ### .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` * * @param {object} obj object constructed Assertion * @param {string} key * @param {unknown} value (optional) * @namespace Utils * @name flag * @returns {unknown | undefined} * @private */ export function flag(obj, key, value) { var flags = obj.__flags || (obj.__flags = Object.create(null)); if (arguments.length === 3) { flags[key] = value; } else { return flags[key]; } }
Version data entries
26 entries across 26 versions & 1 rubygems