enforcer.js
//various operations to remove macro aspects (globals) from protocol definition
various operations to remove macro aspects (globals) from protocol definition
various operations to remove macro aspects ( globals ) from protocol definition
function generate(protocol){
			var p = protocol
			if (p['type']){
				if (p.type === "object"){
					check_keys(p,OBJ_REQ_KEYS,["*"])
					p = eval_globals(p)
					if (p['#']){
						delete p['#']
					}
					return create_enforcer(p)
				}
				if (p.type === "string"){
					return function(x){
						return (typeof(x) === "string")
					}
				}
			}
		}
function generate ( protocol ) { var p = protocol if ( p [ 'type' ] ) { if ( p . type === "object" ) { check_keys ( p , OBJ_REQ_KEYS , [ "*" ] ) p = eval_globals ( p ) if ( p [ '#' ] ) { delete p [ '#' ] } return create_enforcer ( p ) } if ( p . type === "string" ) { return function ( x ) { return ( typeof ( x ) === "string" ) } } } }
various operations to remove macro aspects (globals) from protocol definition
various operations to remove macro aspects ( globals ) from protocol definition
//make nice var name //test req keys // remove possible top level global: