can-define.js
function(definition, behavior, value) {
	if(behavior === "enumerable") {
		// treat enumerable like serialize
		definition.serialize = !!value;
	}
	else if(behavior === "type") {
		var behaviorDef = value;
		if(typeof behaviorDef === "string") {
			behaviorDef = define.types[behaviorDef];
			if(typeof behaviorDef === "object" && !isDefineType(behaviorDef)) {
				assign(definition, behaviorDef);
				behaviorDef = behaviorDef[behavior];
			}
		}
		if (typeof behaviorDef !== 'undefined') {
			definition[behavior] = behaviorDef;
		}
	}
	else {
		definition[behavior] = value;
	}
}
function(definition, behavior, value) {
	if(behavior === "enumerable") {
		// treat enumerable like serialize
		definition.serialize = !!value;
	}
	else if(behavior === "type") {
		var behaviorDef = value;
		if(typeof behaviorDef === "string") {
			behaviorDef = define.types[behaviorDef];
			if(typeof behaviorDef === "object" && !isDefineType(behaviorDef)) {
				assign(definition, behaviorDef);
				behaviorDef = behaviorDef[behavior];
			}
		}
		if (typeof behaviorDef !== 'undefined') {
			definition[behavior] = behaviorDef;
		}
	}
	else {
		definition[behavior] = value;
	}
}
function ( definition , behavior , value ) { if ( behavior === "enumerable" ) { // treat enumerable like serialize definition . serialize = ! ! value ; } else if ( behavior === "type" ) { var behaviorDef = value ; if ( typeof behaviorDef === "string" ) { behaviorDef = define . types [ behaviorDef ] ; if ( typeof behaviorDef === "object" && ! isDefineType ( behaviorDef ) ) { assign ( definition , behaviorDef ) ; behaviorDef = behaviorDef [ behavior ] ; } } if ( typeof behaviorDef !== 'undefined' ) { definition [ behavior ] = behaviorDef ; } } else { definition [ behavior ] = value ; } }
This cleans up a particular behavior and adds it to the definition
This cleans up a particular behavior and adds it to the definition