Add comprehensive tests for role middleware and fix package dependencies
Some checks are pending
Docker Test / test (push) Waiting to run
Some checks are pending
Docker Test / test (push) Waiting to run
This commit is contained in:
parent
64aa924270
commit
bfd432d094
1884 changed files with 384668 additions and 84 deletions
33
node_modules/chai/lib/chai/utils/flag.js
generated
vendored
Normal file
33
node_modules/chai/lib/chai/utils/flag.js
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/*!
|
||||
* 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} object constructed Assertion
|
||||
* @param {String} key
|
||||
* @param {Mixed} value (optional)
|
||||
* @namespace Utils
|
||||
* @name flag
|
||||
* @api private
|
||||
*/
|
||||
|
||||
module.exports = 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];
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue