lib/runner.js
function validateObject(job, object, callback) {
		if (typeof object.value === 'undefined') {
			var onLoad = function (err, obj) {
				if (err) {
					job.error = err;
					return callback(err);
				}
				object.value = obj;
				doValidateObject(job, object, callback);
			};
			var opts = {
				timeout: (job.context.options.timeout || 5000)
			};
			//TODO verify http:, file: and plain paths all load properly
			if (object.path) {
				loader.loadPath(object.path, opts, onLoad);
			}
			else if (object.url) {
				loader.load(object.url, opts, onLoad);
			}
			else {
				callback(new Error('object missing value, path or url'));
			}
		}
		else {
			doValidateObject(job, object, callback);
		}
	}
function validateObject(job, object, callback) {
		if (typeof object.value === 'undefined') {
			var onLoad = function (err, obj) {
				if (err) {
					job.error = err;
					return callback(err);
				}
				object.value = obj;
				doValidateObject(job, object, callback);
			};
			var opts = {
				timeout: (job.context.options.timeout || 5000)
			};
			//TODO verify http:, file: and plain paths all load properly
			if (object.path) {
				loader.loadPath(object.path, opts, onLoad);
			}
			else if (object.url) {
				loader.load(object.url, opts, onLoad);
			}
			else {
				callback(new Error('object missing value, path or url'));
			}
		}
		else {
			doValidateObject(job, object, callback);
		}
	}
function validateObject ( job , object , callback ) { if ( typeof object . value === 'undefined' ) { var onLoad = function ( err , obj ) { if ( err ) { job . error = err ; return callback ( err ) ; } object . value = obj ; doValidateObject ( job , object , callback ) ; } ; var opts = { timeout : ( job . context . options . timeout || 5000 ) } ; //TODO verify http:, file: and plain paths all load properly if ( object . path ) { loader . loadPath ( object . path , opts , onLoad ) ; } else if ( object . url ) { loader . load ( object . url , opts , onLoad ) ; } else { callback ( new Error ( 'object missing value, path or url' ) ) ; } } else { doValidateObject ( job , object , callback ) ; } }
validate single object
validate single object