all files / keystone/lib/list/ set.js

66.67% Statements 4/6
50% Branches 1/2
100% Functions 1/1
66.67% Lines 4/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17              472× 472×            
/**
 * Gets and Sets list options. Aliased as .get()
 *
 * Example:
 *     list.set('test') // returns the 'test' value
 *     list.set('test', value) // sets the 'test' option to `value`
 */
function set (key, value) {
	Eif (arguments.length === 1) {
		return this.options[key];
	}
	this.options[key] = value;
	return value;
}
 
module.exports = set;