Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updating minified js.

  • Loading branch information...
commit b1c0565d934adf3c671841c5abcda5fcaf3818d6 1 parent e7ba95b
@molnarg authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  js-schema.min.js
View
2  js-schema.min.js
@@ -1 +1 @@
-(function(){var e=function(t,n){var r=e.resolve(t,n||"/"),i=e.modules[r];if(!i)throw new Error("Failed to resolve module "+t+", tried "+r);var s=i._cached?i._cached:i();return s};e.paths=[],e.modules={},e.extensions=[".js",".coffee"],e._core={assert:!0,events:!0,fs:!0,path:!0,vm:!0},e.resolve=function(){return function(t,n){function u(t){if(e.modules[t])return t;for(var n=0;n<e.extensions.length;n++){var r=e.extensions[n];if(e.modules[t+r])return t+r}}function a(t){t=t.replace(/\/+$/,"");var n=t+"/package.json";if(e.modules[n]){var i=e.modules[n](),s=i.browserify;if(typeof s=="object"&&s.main){var o=u(r.resolve(t,s.main));if(o)return o}else if(typeof s=="string"){var o=u(r.resolve(t,s));if(o)return o}else if(i.main){var o=u(r.resolve(t,i.main));if(o)return o}}return u(t+"/index")}function f(e,t){var n=l(t);for(var r=0;r<n.length;r++){var i=n[r],s=u(i+"/"+e);if(s)return s;var o=a(i+"/"+e);if(o)return o}var s=u(e);if(s)return s}function l(e){var t;e==="/"?t=[""]:t=r.normalize(e).split("/");var n=[];for(var i=t.length-1;i>=0;i--){if(t[i]==="node_modules")continue;var s=t.slice(0,i+1).join("/")+"/node_modules";n.push(s)}return n}n||(n="/");if(e._core[t])return t;var r=e.modules.path();n=r.resolve("/",n);var i=n||"/";if(t.match(/^(?:\.\.?\/|\/)/)){var s=u(r.resolve(i,t))||a(r.resolve(i,t));if(s)return s}var o=f(t,i);if(o)return o;throw new Error("Cannot find module '"+t+"'")}}(),e.alias=function(t,n){var r=e.modules.path(),i=null;try{i=e.resolve(t+"/package.json","/")}catch(s){i=e.resolve(t,"/")}var o=r.dirname(i),u=(Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t})(e.modules);for(var a=0;a<u.length;a++){var f=u[a];if(f.slice(0,o.length+1)===o+"/"){var l=f.slice(o.length);e.modules[n+l]=e.modules[o+l]}else f===o&&(e.modules[n]=e.modules[o])}},e.define=function(t,n){var r=e._core[t]?"":e.modules.path().dirname(t),i=function(t){return e(t,r)};i.resolve=function(t){return e.resolve(t,r)},i.modules=e.modules,i.define=e.define;var s={exports:{}};e.modules[t]=function(){return e.modules[t]._cached=s.exports,n.call(s.exports,i,s,s.exports,r,t),e.modules[t]._cached=s.exports,s.exports}},typeof process=="undefined"&&(process={}),process.nextTick||(process.nextTick=function(){var e=[],t=typeof window!="undefined"&&window.postMessage&&window.addEventListener;return t&&window.addEventListener("message",function(t){if(t.source===window&&t.data==="browserify-tick"){t.stopPropagation();if(e.length>0){var n=e.shift();n()}}},!0),function(n){t?(e.push(n),window.postMessage("browserify-tick","*")):setTimeout(n,0)}}()),process.title||(process.title="browser"),process.binding||(process.binding=function(t){if(t==="evals")return e("vm");throw new Error("No such module")}),process.cwd||(process.cwd=function(){return"."}),process.env||(process.env={}),process.argv||(process.argv=[]),e.define("path",function(e,t,n,r,i){function s(e,t){var n=[];for(var r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}function o(e,t){var n=0;for(var r=e.length;r>=0;r--){var i=e[r];i=="."?e.splice(r,1):i===".."?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var u=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;n.resolve=function(){var e="",t=!1;for(var n=arguments.length;n>=-1&&!t;n--){var r=n>=0?arguments[n]:process.cwd();if(typeof r!="string"||!r)continue;e=r+"/"+e,t=r.charAt(0)==="/"}return e=o(s(e.split("/"),function(e){return!!e}),!t).join("/"),(t?"/":"")+e||"."},n.normalize=function(e){var t=e.charAt(0)==="/",n=e.slice(-1)==="/";return e=o(s(e.split("/"),function(e){return!!e}),!t).join("/"),!e&&!t&&(e="."),e&&n&&(e+="/"),(t?"/":"")+e},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(s(e,function(e,t){return e&&typeof e=="string"}).join("/"))},n.dirname=function(e){var t=u.exec(e)[1]||"",n=!1;return t?t.length===1||n&&t.length<=3&&t.charAt(1)===":"?t:t.substring(0,t.length-1):"."},n.basename=function(e,t){var n=u.exec(e)[2]||"";return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},n.extname=function(e){return u.exec(e)[3]||""}}),e.define("/lib/schema.js",function(e,t,n,r,i){var s=e("./Schema"),o=t.exports=function(e){var t,n;arguments.length===2&&(t=e,e=arguments[1]);if(this instanceof o){var r=s.extend(e);return n=new r,t&&(n.doc=t),n.wrap()}return n=s.fromJS(e),o.self.resolve(n),t&&(n.doc=t),n.wrap()};o.Schema=s,o.toJSON=function(e){return s.fromJS(e).toJSON()},o.fromJS=function(e){return s.fromJS(e).wrap()},o.fromJSON=function(e){return s.fromJSON(e).wrap()}}),e.define("/lib/Schema.js",function(e,t,n,r,i){function u(e){return function(){if(o)return e.apply(this,arguments);o=!0;var t=e.apply(this,arguments);for(var n in u)delete u[n];return o=!1,t}}function a(e,t){var n=e.length,r;while(n--){r=e[n](t);if(r!=null)return r}}var s=t.exports=function(){};s.prototype={wrap:function(){if(this.wrapped)return this.validate;this.wrapped=!0;var e=["toJSON","unwrap"];e=e.concat(this.publicFunctions||[]);for(var t=0;t<e.length;t++){if(!this[e[t]])continue;this.validate[e[t]]=this[e[t]].bind(this)}return this.validate},unwrap:function(){return this},toJSON:u(function(e){var t,n=s.session;n.serialized||(n.serialized={objects:[],jsons:[],ids:[]});var r=n.serialized.objects.indexOf(this);if(e&&r!==-1){t=n.serialized.jsons[r];if(t.id==null){do t.id="id-"+Math.floor(Math.random()*1e5);while(n.serialized.ids.indexOf(t.id)!==-1);n.serialized.ids.push(t.id)}t={$ref:t.id}}else t={},this.doc!=null&&(t.description=this.doc),n.serialized.objects.push(this),n.serialized.jsons.push(t);return t})},s.extend=function(e){if(!e.validate)throw new Error("Schema objects must have a validate function.");var t=function(){this.initialize&&this.initialize.apply(this,arguments),this.validate=this.validate.bind(this),this.validate.schema=this.validate},n=Object.create(s.prototype);for(var r in e)n[r]=e[r];return t.prototype=n,t};var o=!1;s.session=u;var f=[];s.fromJS=a.bind(null,f),s.fromJS.def=Array.prototype.push.bind(f);var l=[];s.fromJSON=u(a.bind(null,l)),s.fromJSON.def=Array.prototype.push.bind(l),s.patterns={},s.extensions={}}),e.define("/lib/patterns/reference.js",function(e,t,n,r,i){var s=e("../Schema"),o=t.exports=s.patterns.ReferenceSchema=s.extend({initialize:function(e){this.value=e},validate:function(e){return e===this.value},toJSON:function(){var e=s.prototype.toJSON.call(this);return e["enum"]=[this.value],e}});s.fromJS.def(function(e){return new o(e)})}),e.define("/lib/patterns/nothing.js",function(e,t,n,r,i){var s=e("../Schema"),o=t.exports=s.patterns.NothingSchema=s.extend({validate:function(e){return e==null},toJSON:function(){return{type:"null"}}}),u=o.instance=new o;s.fromJS.def(function(e){if(e===null)return u}),s.fromJSON.def(function(e){if(e.type==="null")return u})}),e.define("/lib/patterns/anything.js",function(e,t,n,r,i){var s=e("../Schema"),o=t.exports=s.patterns.AnythingSchema=s.extend({validate:function(e){return e!=null},toJSON:function(){return{type:"any"}}}),u=o.instance=new o;s.fromJS.def(function(e){if(e===undefined)return u}),s.fromJSON.def(function(e){if(e.type==="any")return u})}),e.define("/lib/patterns/object.js",function(e,t,n,r,i){var s=e("../Schema"),o=e("./anything").instance,u=e("./nothing").instance,a=t.exports=s.patterns.ObjectSchema=s.extend({initialize:function(e,t){var n=this;this.other=t||o,this.properties=e||[],this.stringProps={},this.regexpProps=[],this.properties.forEach(function(e){typeof e.key=="string"?n.stringProps[e.key]=e:n.regexpProps.push(e)})},validate:function(e){var t=this;if(e==null)return!1;var n=Object.keys(this.stringProps).every(function(n){return t.stringProps[n].min===0&&!(n in e)||t.stringProps[n].value.validate(e[n])});if(!n)return!1;if(!this.regexpProps.length&&this.other===o)return!0;var r;for(var i in e){r=!1;var s=Object.keys(this.regexpProps).every(function(n){return!t.regexpProps[n].key.test(n)||(r=!0)&&t.regexpProps[n].value.validate(e[n])});if(!s)return!1;if(!r&&!(i in this.stringProps)&&!this.other.validate(e[i]))return!1}return!0},toJSON:s.session(function(){var e,t,n,r=s.prototype.toJSON.call(this,!0);if(r["$ref"]!=null)return r;r.type="object";for(e in this.stringProps)t=this.stringProps[e],r.properties=r.properties||{},r.properties[t.key]=t.value.toJSON(),t.min===1&&(r.properties[t.key].required=!0),t.title&&(r.properties[t.key].title=t.title);for(e=0;e<this.regexpProps.length;e++)t=this.regexpProps[e],r.patternProperties=r.patternProperties||{},n=t.key.toString(),n=n.substr(2,n.length-4),r.patternProperties[n]=t.value.toJSON(),t.title&&(r.patternProperties[n].title=t.title);return this.other!==o&&(r.additionalProperties=this.other===u?!1:this.other.toJSON()),r})}),f=function(){var e="[](){}^$?*+.".split("").map(function(e){return RegExp("(\\\\)*\\"+e,"g")}),t="bBwWdDsS".split("").map(function(e){return RegExp("(\\\\)*"+e,"g")});return function(n){var r,i,s;for(r=0;r<e.length;r++){s=n.match(e[r]);if(!s)continue;for(i=0;i<s.length;i++)if(s[i].length%2===1)return RegExp("^"+n+"$")}for(r=0;r<t.length;r++){s=n.match(t[r]);if(!s)continue;for(i=0;i<s.length;i++)if(s[i].length%2===0)return RegExp("^"+n+"$")}for(r=0;r<e.length;r++)n=n.replace(e[r],function(e){return e.substr(1)});return n}}();s.fromJS.def(function(e){if(e instanceof Object){var t,n,r=[];for(var i in e){n={value:s.fromJS(e[i])};if(i==="*"){t=n.value;continue}n.min=i[0]==="*"||i[0]==="?"?0:1,n.max=i[0]==="*"||i[0]==="+"?Infinity:1,i=i.replace(/^[*?+]/,""),i=i.replace(/\s*:[^:]+$/,function(e){return n.title=e.replace(/^\s*:\s*/,""),""}),n.key=f(i),r.push(n)}return new a(r,t)}return}),s.fromJSON.def(function(e){if(!e||e.type!=="object")return;var t,n=[];for(t in e.properties)n.push({min:e.properties[t].required?1:0,max:1,key:t,value:s.fromJSON(e.properties[t]),title:e.properties[t].title});for(t in e.patternProperties)n.push({min:0,max:Infinity,key:RegExp("^"+t+"$"),value:s.fromJSON(e.patternProperties[t]),title:e.patternProperties[t].title});var r;return e.additionalProperties!==undefined&&(r=e.additionalProperties===!1?u:s.fromJSON(e.additionalProperties)),new a(n,r)})}),e.define("/lib/patterns/or.js",function(e,t,n,r,i){var s=e("../Schema"),o=e("../patterns/equality"),u=t.exports=s.patterns.OrSchema=s.extend({initialize:function(e){this.schemas=e},validate:function(e){return this.schemas.some(function(t){return t.validate(e)})},toJSON:s.session(function(){var e=s.prototype.toJSON.call(this,!0),t=this.schemas.map(function(e){return e.toJSON()}),n=t.every(function(e){return e["enum"]instanceof Array&&e["enum"].length===1});return e["$ref"]!=null?e:(n?e["enum"]=t.map(function(e){return e["enum"][0]}):e.type=t.map(function(e){var t=typeof e.type=="string"&&Object.keys(e).length===1;return t?e.type:e}),e)})});s.fromJS.def(function(e){if(e instanceof Array)return new u(e.map(function(e){return e===undefined?s.self:s.fromJS(e)}))}),s.fromJSON.def(function(e){if(!e)return;if(e["enum"]instanceof Array)return new u(e["enum"].map(function(e){return new o(e)}));if(e.type instanceof Array)return new u(e.type.map(function(e){return s.fromJSON(typeof e=="string"?{type:e}:e)}))})}),e.define("/lib/patterns/equality.js",function(e,t,n,r,i){var s=e("../Schema"),o=function(e,t){if(Object(e)!==e||Object(t)!==t)return e===t;if(e instanceof Array!=t instanceof Array)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!o(e[n],t[n]))return!1;return!0},u=t.exports=s.patterns.EqualitySchema=s.extend({initialize:function(e){this.object=e},validate:function(e){return o(e,this.object)},toJSON:function(){var e=s.prototype.toJSON.call(this);return e["enum"]=[this.object],e}});s.fromJS.def(function(e){if(e instanceof Array&&e.length===1)return new u(e[0])})}),e.define("/lib/patterns/regexp.js",function(e,t,n,r,i){var s=e("../Schema"),o=t.exports=s.patterns.RegexpSchema=s.extend({initialize:function(e){this.regexp=e},validate:function(e){return Object(e)instanceof String&&(!this.regexp||this.regexp.test(e))},toJSON:function(){var e=s.prototype.toJSON.call(this);return e.type="string",this.regexp&&(e.pattern=this.regexp.toString(),e.pattern=e.pattern.substr(1,e.pattern.length-2)),e}});s.fromJSON.def(function(e){if(!e||e.type!=="string")return;return"pattern"in e?new o(RegExp("^"+e.pattern+"$")):"minLength"in e||"maxLength"in e?new o(RegExp("^.{"+[e.minLength||0,e.maxLength].join(",")+"}$")):new o}),s.fromJS.def(function(e){if(e instanceof RegExp)return new o(e)})}),e.define("/lib/patterns/class.js",function(e,t,n,r,i){var s=e("../Schema"),o=t.exports=s.patterns.ClassSchema=s.extend({initialize:function(e){this.constructor=e},validate:function(e){return e instanceof this.constructor}});s.fromJS.def(function(e){if(e instanceof Function)return e.schema instanceof Function?e.schema.unwrap():new o(e);return})}),e.define("/lib/patterns/schema.js",function(e,t,n,r,i){var s=e("../Schema");s.fromJS.def(function(e){if(e instanceof s)return e})}),e.define("/lib/extensions/Boolean.js",function(e,t,n,r,i){var s=e("../Schema"),o=t.exports=s.extensions.BooleanSchema=new s.extend({validate:function(e){return Object(e)instanceof Boolean},toJSON:function(){return{type:"boolean"}}}),u=t.exports=(new o).wrap();s.fromJSON.def(function(e){if(!e||e.type!=="boolean")return;return u}),Boolean.schema=u}),e.define("/lib/extensions/Number.js",function(e,t,n,r,i){var s=e("../Schema"),o=t.exports=s.extensions.NumberSchema=s.extend({initialize:function(e,t,n,r,i){this.minimum=e!=null?e:-Infinity,this.exclusiveMinimum=t,this.maximum=e!=null?n:Infinity,this.exclusiveMaximum=r,this.divisibleBy=i||0},min:function(e){return(new o(e,!1,this.maximum,this.exclusiveMaximum,this.divisibleBy)).wrap()},above:function(e){return(new o(e,!0,this.maximum,this.exclusiveMaximum,this.divisibleBy)).wrap()},max:function(e){return(new o(this.minimum,this.exclusiveMinimum,e,!1,this.divisibleBy)).wrap()},below:function(e){return(new o(this.minimum,this.exclusiveMinimum,e,!0,this.divisibleBy)).wrap()},step:function(e){return(new o(this.minimum,this.exclusiveMinimum,this.maximum,this.exclusiveMaximum,e)).wrap()},publicFunctions:["min","above","max","below","step"],validate:function(e){return Object(e)instanceof Number&&(this.exclusiveMinimum?e>this.minimum:e>=this.minimum)&&(this.exclusiveMaximum?e<this.maximum:e<=this.maximum)&&(this.divisibleBy===0||e%this.divisibleBy===0)},toJSON:function(){var e=s.prototype.toJSON.call(this);return e.type=this.divisibleBy!==0&&this.divisibleBy%1===0?"integer":"number",this.divisibleBy!==0&&this.divisibleBy!==1&&(e.divisibleBy=this.divisibleBy),this.minimum!==-Infinity&&(e.minimum=this.minimum,this.exclusiveMinimum===!0&&(e.exclusiveMinimum=!0)),this.maximum!==Infinity&&(e.maximum=this.maximum,this.exclusiveMaximum===!0&&(e.exclusiveMaximum=!0)),e}});s.fromJSON.def(function(e){if(!e||e.type!=="number"&&e.type!=="integer")return;return new o(e.minimum,e.exclusiveMinimum,e.maximum,e.exclusiveMaximum,e.divisibleBy||(e.type==="integer"?1:0))}),Number.schema=(new o).wrap(),Number.min=Number.schema.min,Number.above=Number.schema.above,Number.max=Number.schema.max,Number.below=Number.schema.below,Number.step=Number.schema.step,Number.Integer=Number.step(1)}),e.define("/lib/extensions/String.js",function(e,t,n,r,i){var s=e("../patterns/regexp");String.of=function(){var e=Array.prototype.slice.call(arguments).reverse(),t=e[0]?"["+e[0]+"]":"[a-zA-Z0-9]",n=e[1],r=e.length>2?e[2]:e[1],i="^"+t+"{"+(r||0)+","+(n||"")+"}$";return(new s(RegExp(i))).wrap()},String.schema=(new s).wrap()}),e.define("/lib/extensions/Object.js",function(e,t,n,r,i){var s=e("../patterns/reference"),o=e("../patterns/equality"),u=e("../patterns/object");Object.like=function(e){return(new o(e)).wrap()},Object.reference=function(e){return(new s(e)).wrap()},Object.schema=(new u).wrap()}),e.define("/lib/extensions/Array.js",function(e,t,n,r,i){var s=e("../Schema"),o=e("../patterns/equality"),u=e("../patterns/anything").instance,a=t.exports=s.extensions.ArraySchema=s.extend({initialize:function(e,t,n){this.itemSchema=e||u,this.min=n||0,this.max=t||Infinity},validate:function(e){if(e instanceof Array){if(this.min===this.max){if(e.length!==this.min)return!1}else{if(this.min>0&&e.length<this.min)return!1;if(this.max<Infinity&&e.length>this.max)return!1}for(var t=0;t<e.length;t++)if(!this.itemSchema.validate(e[t]))return!1;return!0}return!1},toJSON:s.session(function(){var e=s.prototype.toJSON.call(this,!0);return e["$ref"]!=null?e:(e.tpye="array",this.min>0&&(e.minItems=this.min),this.max<Infinity&&(e.maxItems=this.max),this.itemSchema!==u&&(e.items=this.itemSchema.toJSON()),e)})});s.fromJSON.def(function(e){if(!e||e.type!=="array")return;if(e.items instanceof Array)return;return new a(s.fromJSON(e.items),e.maxItems,e.minItems)}),Array.of=function(){var e=Array.prototype.slice.call(arguments).reverse();return e.length===2&&(e[2]=e[1]),(new a(s.fromJS(e[0]),e[1],e[2])).wrap()},Array.like=function(e){return(new o(e)).wrap()},Array.schema=(new a).wrap()}),e.define("/lib/extensions/Function.js",function(e,t,n,r,i){var s=e("../patterns/reference");Function.reference=function(e){return(new s(e)).wrap()}}),e.define("/lib/extensions/Schema.js",function(e,t,n,r,i){function a(e){return e.resolve=function(){return s.self=o.self=a(new u),u.prototype.resolve.apply(this,arguments)},e}var s=e("../Schema"),o=e("../schema"),u=t.exports=s.extensions.SchemaReference=s.extend({validate:function(){throw new Error("Trying to validate unresolved schema reference.")},resolve:function(e){var t=s.fromJS(e);for(var n in t)t[n]instanceof Function?this[n]=t[n].bind(t):this[n]=t[n];delete this.resolve},publicFunctions:["resolve"]});o.reference=function(e){return new u},s.self=o.self=a(new u),s.fromJSON.def(function(e){if(e.id==null&&e["$ref"]==null)return;var t,n=s.session;n.deserialized||(n.deserialized={references:{},subscribers:{}});if(e.id!=null){t=e.id,delete e.id;var r=s.fromJSON(e);return e.id=t,n.deserialized.references[t]=r,(n.deserialized.subscribers[t]||[]).forEach(function(e){e(r)}),r}t=e.$ref;if(n.deserialized.references[t])return n.deserialized.references[t];n.deserialized.subscribers[t]||(n.deserialized.subscribers[t]=[]);var i=new u;return n.deserialized.subscribers[t].push(i.resolve.bind(i)),i})}),e.define("/index.js",function(e,t,n,r,i){t.exports=e("./lib/schema"),e("./lib/patterns/reference"),e("./lib/patterns/nothing"),e("./lib/patterns/anything"),e("./lib/patterns/object"),e("./lib/patterns/or"),e("./lib/patterns/equality"),e("./lib/patterns/regexp"),e("./lib/patterns/class"),e("./lib/patterns/schema"),e("./lib/extensions/Boolean"),e("./lib/extensions/Number"),e("./lib/extensions/String"),e("./lib/extensions/Object"),e("./lib/extensions/Array"),e("./lib/extensions/Function"),e("./lib/extensions/Schema")}),window.schema=e("/index.js")})();
+(function(){var require=function(file,cwd){var resolved=require.resolve(file,cwd||"/");var mod=require.modules[resolved];if(!mod)throw new Error("Failed to resolve module "+file+", tried "+resolved);var cached=require.cache[resolved];var res=cached?cached.exports:mod();return res};require.paths=[];require.modules={};require.cache={};require.extensions=[".js",".coffee",".json"];require._core={assert:true,events:true,fs:true,path:true,vm:true};require.resolve=function(){return function(x,cwd){if(!cwd)cwd="/";if(require._core[x])return x;var path=require.modules.path();cwd=path.resolve("/",cwd);var y=cwd||"/";if(x.match(/^(?:\.\.?\/|\/)/)){var m=loadAsFileSync(path.resolve(y,x))||loadAsDirectorySync(path.resolve(y,x));if(m)return m}var n=loadNodeModulesSync(x,y);if(n)return n;throw new Error("Cannot find module '"+x+"'");function loadAsFileSync(x){x=path.normalize(x);if(require.modules[x]){return x}for(var i=0;i<require.extensions.length;i++){var ext=require.extensions[i];if(require.modules[x+ext])return x+ext}}function loadAsDirectorySync(x){x=x.replace(/\/+$/,"");var pkgfile=path.normalize(x+"/package.json");if(require.modules[pkgfile]){var pkg=require.modules[pkgfile]();var b=pkg.browserify;if(typeof b==="object"&&b.main){var m=loadAsFileSync(path.resolve(x,b.main));if(m)return m}else if(typeof b==="string"){var m=loadAsFileSync(path.resolve(x,b));if(m)return m}else if(pkg.main){var m=loadAsFileSync(path.resolve(x,pkg.main));if(m)return m}}return loadAsFileSync(x+"/index")}function loadNodeModulesSync(x,start){var dirs=nodeModulesPathsSync(start);for(var i=0;i<dirs.length;i++){var dir=dirs[i];var m=loadAsFileSync(dir+"/"+x);if(m)return m;var n=loadAsDirectorySync(dir+"/"+x);if(n)return n}var m=loadAsFileSync(x);if(m)return m}function nodeModulesPathsSync(start){var parts;if(start==="/")parts=[""];else parts=path.normalize(start).split("/");var dirs=[];for(var i=parts.length-1;i>=0;i--){if(parts[i]==="node_modules")continue;var dir=parts.slice(0,i+1).join("/")+"/node_modules";dirs.push(dir)}return dirs}}}();require.alias=function(from,to){var path=require.modules.path();var res=null;try{res=require.resolve(from+"/package.json","/")}catch(err){res=require.resolve(from,"/")}var basedir=path.dirname(res);var keys=(Object.keys||function(obj){var res=[];for(var key in obj)res.push(key);return res})(require.modules);for(var i=0;i<keys.length;i++){var key=keys[i];if(key.slice(0,basedir.length+1)===basedir+"/"){var f=key.slice(basedir.length);require.modules[to+f]=require.modules[basedir+f]}else if(key===basedir){require.modules[to]=require.modules[basedir]}}};(function(){var process={};var global=typeof window!=="undefined"?window:{};var definedProcess=false;require.define=function(filename,fn){if(!definedProcess&&require.modules.__browserify_process){process=require.modules.__browserify_process();definedProcess=true}var dirname=require._core[filename]?"":require.modules.path().dirname(filename);var require_=function(file){var requiredModule=require(file,dirname);var cached=require.cache[require.resolve(file,dirname)];if(cached&&cached.parent===null){cached.parent=module_}return requiredModule};require_.resolve=function(name){return require.resolve(name,dirname)};require_.modules=require.modules;require_.define=require.define;require_.cache=require.cache;var module_={id:filename,filename:filename,exports:{},loaded:false,parent:null};require.modules[filename]=function(){require.cache[filename]=module_;fn.call(module_.exports,require_,module_,module_.exports,dirname,filename,process,global);module_.loaded=true;return module_.exports}}})();require.define("path",function(require,module,exports,__dirname,__filename,process,global){function filter(xs,fn){var res=[];for(var i=0;i<xs.length;i++){if(fn(xs[i],i,xs))res.push(xs[i])}return res}function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length;i>=0;i--){var last=parts[i];if(last=="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"||!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.slice(-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){return p&&typeof p==="string"}).join("/"))};exports.dirname=function(path){var dir=splitPathRe.exec(path)[1]||"";var isWindows=false;if(!dir){return"."}else if(dir.length===1||isWindows&&dir.length<=3&&dir.charAt(1)===":"){return dir}else{return dir.substring(0,dir.length-1)}};exports.basename=function(path,ext){var f=splitPathRe.exec(path)[2]||"";if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length)}return f};exports.extname=function(path){return splitPathRe.exec(path)[3]||""};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")}});require.define("__browserify_process",function(require,module,exports,__dirname,__filename,process,global){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}if(canPost){var queue=[];window.addEventListener("message",function(ev){if(ev.source===window&&ev.data==="browserify-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("browserify-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];process.binding=function(name){if(name==="evals")return require("vm");else throw new Error("No such module. (Possibly not yet loaded)")};(function(){var cwd="/";var path;process.cwd=function(){return cwd};process.chdir=function(dir){if(!path)path=require("path");cwd=path.resolve(dir,cwd)}})()});require.define("/lib/schema.js",function(require,module,exports,__dirname,__filename,process,global){var Schema=require("./BaseSchema");var schema=module.exports=function(schemaDescription){var doc,schemaObject;if(arguments.length===2){doc=schemaDescription;schemaDescription=arguments[1]}if(this instanceof schema){var constructor=Schema.extend(schemaDescription);schemaObject=new constructor;if(doc)schemaObject.doc=doc;return schemaObject.wrap()}else{schemaObject=Schema.fromJS(schemaDescription);schema.self.resolve(schemaObject);if(doc)schemaObject.doc=doc;return schemaObject.wrap()}};schema.Schema=Schema;schema.toJSON=function(sch){return Schema.fromJS(sch).toJSON()};schema.fromJS=function(sch){return Schema.fromJS(sch).wrap()};schema.fromJSON=function(sch){return Schema.fromJSON(sch).wrap()}});require.define("/lib/BaseSchema.js",function(require,module,exports,__dirname,__filename,process,global){var Schema=module.exports=function(){};Schema.prototype={wrap:function(){if(this.wrapped)return this.validate;this.wrapped=true;var publicFunctions=["toJSON","unwrap"];publicFunctions=publicFunctions.concat(this.publicFunctions||[]);for(var i=0;i<publicFunctions.length;i++){if(!this[publicFunctions[i]])continue;this.validate[publicFunctions[i]]=this[publicFunctions[i]].bind(this)}return this.validate},unwrap:function(){return this},toJSON:session(function(makeReference){var json,session=Schema.session;if(!session.serialized)session.serialized={objects:[],jsons:[],ids:[]};var index=session.serialized.objects.indexOf(this);if(makeReference&&index!==-1){json=session.serialized.jsons[index];if(json.id==null){do{json.id="id-"+Math.floor(Math.random()*1e5)}while(session.serialized.ids.indexOf(json.id)!==-1);session.serialized.ids.push(json.id)}json={$ref:json.id}}else{json={};if(this.doc!=null)json.description=this.doc;session.serialized.objects.push(this);session.serialized.jsons.push(json)}return json})};Schema.extend=function(descriptor){if(!descriptor.validate){throw new Error("Schema objects must have a validate function.")}var constructor=function(){if(this.initialize)this.initialize.apply(this,arguments);this.validate=this.validate.bind(this);this.validate.schema=this.validate};var prototype=Object.create(Schema.prototype);for(var key in descriptor)prototype[key]=descriptor[key];constructor.prototype=prototype;return constructor};var active=false;function session(f){return function(){if(active){return f.apply(this,arguments)}else{active=true;var result=f.apply(this,arguments);for(var i in session)delete session[i];active=false;return result}}}Schema.session=session;function lastDefinedResult(functions,arg){var i=functions.length,result;while(i--){result=functions[i](arg);if(result!=null)return result}}var fromJSdefs=[];Schema.fromJS=lastDefinedResult.bind(null,fromJSdefs);Schema.fromJS.def=Array.prototype.push.bind(fromJSdefs);var fromJSONdefs=[];Schema.fromJSON=session(lastDefinedResult.bind(null,fromJSONdefs));Schema.fromJSON.def=Array.prototype.push.bind(fromJSONdefs);Schema.patterns={};Schema.extensions={}});require.define("/lib/patterns/reference.js",function(require,module,exports,__dirname,__filename,process,global){var Schema=require("../BaseSchema");var ReferenceSchema=module.exports=Schema.patterns.ReferenceSchema=Schema.extend({initialize:function(value){this.value=value},validate:function(instance){return instance===this.value},toJSON:function(){var json=Schema.prototype.toJSON.call(this);json["enum"]=[this.value];return json}});Schema.fromJS.def(function(value){return new ReferenceSchema(value)})});require.define("/lib/patterns/nothing.js",function(require,module,exports,__dirname,__filename,process,global){var Schema=require("../BaseSchema");var NothingSchema=module.exports=Schema.patterns.NothingSchema=Schema.extend({validate:function(instance){return instance==null},toJSON:function(){return{type:"null"}}});var nothing=NothingSchema.instance=new NothingSchema;Schema.fromJS.def(function(sch){if(sch===null)return nothing});Schema.fromJSON.def(function(sch){if(sch.type==="null")return nothing})});require.define("/lib/patterns/anything.js",function(require,module,exports,__dirname,__filename,process,global){var Schema=require("../BaseSchema");var AnythingSchema=module.exports=Schema.patterns.AnythingSchema=Schema.extend({validate:function(instance){return instance!=null},toJSON:function(){return{type:"any"}}});var anything=AnythingSchema.instance=new AnythingSchema;Schema.fromJS.def(function(sch){if(sch===undefined)return anything});Schema.fromJSON.def(function(sch){if(sch.type==="any")return anything})});require.define("/lib/patterns/object.js",function(require,module,exports,__dirname,__filename,process,global){var Schema=require("../BaseSchema"),anything=require("./anything").instance,nothing=require("./nothing").instance;var ObjectSchema=module.exports=Schema.patterns.ObjectSchema=Schema.extend({initialize:function(properties,other){var self=this;this.other=other||anything;this.properties=properties||[];this.stringProps={},this.regexpProps=[];this.properties.forEach(function(property){if(typeof property.key==="string"){self.stringProps[property.key]=property}else{self.regexpProps.push(property)}})},validate:function(instance){var self=this;if(instance==null)return false;var stringPropsValid=Object.keys(this.stringProps).every(function(key){return self.stringProps[key].min===0&&!(key in instance)||self.stringProps[key].value.validate(instance[key])});if(!stringPropsValid)return false;if(!this.regexpProps.length&&this.other===anything)return true;var checked;for(var key in instance){checked=false;var regexpPropsValid=Object.keys(this.regexpProps).every(function(key){return!self.regexpProps[key].key.test(key)||(checked=true)&&self.regexpProps[key].value.validate(instance[key])});if(!regexpPropsValid)return false;if(!checked&&!(key in this.stringProps)&&!this.other.validate(instance[key]))return false}return true},toJSON:Schema.session(function(){var i,property,regexp,json=Schema.prototype.toJSON.call(this,true);if(json["$ref"]!=null)return json;json.type="object";for(i in this.stringProps){property=this.stringProps[i];json.properties=json.properties||{};json.properties[property.key]=property.value.toJSON();if(property.min===1)json.properties[property.key].required=true;if(property.title)json.properties[property.key].title=property.title}for(i=0;i<this.regexpProps.length;i++){property=this.regexpProps[i];json.patternProperties=json.patternProperties||{};regexp=property.key.toString();regexp=regexp.substr(2,regexp.length-4);json.patternProperties[regexp]=property.value.toJSON();if(property.title)json.patternProperties[regexp].title=property.title}if(this.other!==anything){json.additionalProperties=this.other===nothing?false:this.other.toJSON()}return json})});var regexpString=function(){var shouldBeEscaped="[](){}^$?*+.".split("").map(function(element){return RegExp("(\\\\)*\\"+element,"g")});var shouldntBeEscaped="bBwWdDsS".split("").map(function(element){return RegExp("(\\\\)*"+element,"g")});return function(string){var i,j,match;for(i=0;i<shouldBeEscaped.length;i++){match=string.match(shouldBeEscaped[i]);if(!match)continue;for(j=0;j<match.length;j++){if(match[j].length%2===1)return RegExp("^"+string+"$")}}for(i=0;i<shouldntBeEscaped.length;i++){match=string.match(shouldntBeEscaped[i]);if(!match)continue;for(j=0;j<match.length;j++){if(match[j].length%2===0)return RegExp("^"+string+"$")}}for(i=0;i<shouldBeEscaped.length;i++){string=string.replace(shouldBeEscaped[i],function(match){return match.substr(1)})}return string}}();Schema.fromJS.def(function(object){if(!(object instanceof Object))return;var other,property,properties=[];for(var key in object){property={value:Schema.fromJS(object[key])};if(key==="*"){other=property.value;continue}property.min=key[0]==="*"||key[0]==="?"?0:1;property.max=key[0]==="*"||key[0]==="+"?Infinity:1;key=key.replace(/^[*?+]/,"");key=key.replace(/\s*:[^:]+$/,function(match){property.title=match.replace(/^\s*:\s*/,"");return""});property.key=regexpString(key);properties.push(property)}return new ObjectSchema(properties,other)});Schema.fromJSON.def(function(json){if(!json||json.type!=="object")return;var key,properties=[];for(key in json.properties){properties.push({min:json.properties[key].required?1:0,max:1,key:key,value:Schema.fromJSON(json.properties[key]),title:json.properties[key].title})}for(key in json.patternProperties){properties.push({min:0,max:Infinity,key:RegExp("^"+key+"$"),value:Schema.fromJSON(json.patternProperties[key]),title:json.patternProperties[key].title})}var other;if(json.additionalProperties!==undefined){other=json.additionalProperties===false?nothing:Schema.fromJSON(json.additionalProperties)}return new ObjectSchema(properties,other)})});require.define("/lib/patterns/or.js",function(require,module,exports,__dirname,__filename,process,global){var Schema=require("../BaseSchema"),EqualitySchema=require("../patterns/equality");var OrSchema=module.exports=Schema.patterns.OrSchema=Schema.extend({initialize:function(schemas){this.schemas=schemas},validate:function(instance){return this.schemas.some(function(sch){return sch.validate(instance)})},toJSON:Schema.session(function(){var json=Schema.prototype.toJSON.call(this,true),subjsons=this.schemas.map(function(sch){return sch.toJSON()}),onlyEquality=subjsons.every(function(json){return json["enum"]instanceof Array&&json["enum"].length===1});if(json["$ref"]!=null)return json;if(onlyEquality){json["enum"]=subjsons.map(function(json){return json["enum"][0]})}else{json["type"]=subjsons.map(function(json){var simpleType=typeof json.type==="string"&&Object.keys(json).length===1;return simpleType?json.type:json})}return json})});Schema.fromJS.def(function(schemas){if(schemas instanceof Array)return new OrSchema(schemas.map(function(sch){return sch===undefined?Schema.self:Schema.fromJS(sch)}))});Schema.fromJSON.def(function(sch){if(!sch)return;if(sch["enum"]instanceof Array){return new OrSchema(sch["enum"].map(function(object){return new EqualitySchema(object)}))}if(sch["type"]instanceof Array){return new OrSchema(sch["type"].map(function(type){return Schema.fromJSON(typeof type==="string"?{type:type}:type)}))}})});require.define("/lib/patterns/equality.js",function(require,module,exports,__dirname,__filename,process,global){var Schema=require("../BaseSchema");var equal=function(a,b){if(Object(a)!==a||Object(b)!==b)return a===b;if(a instanceof Array!==b instanceof Array)return false;if(Object.keys(a).length!==Object.keys(b).length)return false;for(var key in a){if(!equal(a[key],b[key]))return false}return true};var EqualitySchema=module.exports=Schema.patterns.EqualitySchema=Schema.extend({initialize:function(object){this.object=object},validate:function(instance){return equal(instance,this.object)},toJSON:function(){var json=Schema.prototype.toJSON.call(this);json["enum"]=[this.object];return json}});Schema.fromJS.def(function(sch){if(sch instanceof Array&&sch.length===1)return new EqualitySchema(sch[0])})});require.define("/lib/patterns/regexp.js",function(require,module,exports,__dirname,__filename,process,global){var Schema=require("../BaseSchema");var RegexpSchema=module.exports=Schema.patterns.RegexpSchema=Schema.extend({initialize:function(regexp){this.regexp=regexp},validate:function(instance){return Object(instance)instanceof String&&(!this.regexp||this.regexp.test(instance))},toJSON:function(){var json=Schema.prototype.toJSON.call(this);json.type="string";if(this.regexp){json.pattern=this.regexp.toString();json.pattern=json.pattern.substr(1,json.pattern.length-2)}return json}});Schema.fromJSON.def(function(sch){if(!sch||sch.type!=="string")return;if("pattern"in sch){return new RegexpSchema(RegExp("^"+sch.pattern+"$"))}else if("minLength"in sch||"maxLength"in sch){return new RegexpSchema(RegExp("^.{"+[sch.minLength||0,sch.maxLength].join(",")+"}$"))}else{return new RegexpSchema}});Schema.fromJS.def(function(regexp){if(regexp instanceof RegExp)return new RegexpSchema(regexp)})});require.define("/lib/patterns/class.js",function(require,module,exports,__dirname,__filename,process,global){var Schema=require("../BaseSchema");var ClassSchema=module.exports=Schema.patterns.ClassSchema=Schema.extend({initialize:function(constructor){this.constructor=constructor},validate:function(instance){return instance instanceof this.constructor}});Schema.fromJS.def(function(constructor){if(!(constructor instanceof Function))return;if(constructor.schema instanceof Function){return constructor.schema.unwrap()}else{return new ClassSchema(constructor)}})});require.define("/lib/patterns/schema.js",function(require,module,exports,__dirname,__filename,process,global){var Schema=require("../BaseSchema");Schema.fromJS.def(function(sch){if(sch instanceof Schema)return sch})});require.define("/lib/extensions/Boolean.js",function(require,module,exports,__dirname,__filename,process,global){var Schema=require("../BaseSchema");var BooleanSchema=module.exports=Schema.extensions.BooleanSchema=new Schema.extend({validate:function(instance){return Object(instance)instanceof Boolean},toJSON:function(){return{type:"boolean"}}});var booleanSchema=module.exports=(new BooleanSchema).wrap();Schema.fromJSON.def(function(sch){if(!sch||sch.type!=="boolean")return;return booleanSchema});Boolean.schema=booleanSchema});require.define("/lib/extensions/Number.js",function(require,module,exports,__dirname,__filename,process,global){var Schema=require("../BaseSchema");var NumberSchema=module.exports=Schema.extensions.NumberSchema=Schema.extend({initialize:function(minimum,exclusiveMinimum,maximum,exclusiveMaximum,divisibleBy){this.minimum=minimum!=null?minimum:-Infinity;this.exclusiveMinimum=exclusiveMinimum;this.maximum=minimum!=null?maximum:Infinity;this.exclusiveMaximum=exclusiveMaximum;this.divisibleBy=divisibleBy||0},min:function(minimum){return new NumberSchema(minimum,false,this.maximum,this.exclusiveMaximum,this.divisibleBy).wrap()},above:function(minimum){return new NumberSchema(minimum,true,this.maximum,this.exclusiveMaximum,this.divisibleBy).wrap()},max:function(maximum){return new NumberSchema(this.minimum,this.exclusiveMinimum,maximum,false,this.divisibleBy).wrap()},below:function(maximum){return new NumberSchema(this.minimum,this.exclusiveMinimum,maximum,true,this.divisibleBy).wrap()},step:function(divisibleBy){return new NumberSchema(this.minimum,this.exclusiveMinimum,this.maximum,this.exclusiveMaximum,divisibleBy).wrap()},publicFunctions:["min","above","max","below","step"],validate:function(instance){return Object(instance)instanceof Number&&(this.exclusiveMinimum?instance>this.minimum:instance>=this.minimum)&&(this.exclusiveMaximum?instance<this.maximum:instance<=this.maximum)&&(this.divisibleBy===0||instance%this.divisibleBy===0)},toJSON:function(){var json=Schema.prototype.toJSON.call(this);json.type=this.divisibleBy!==0&&this.divisibleBy%1===0?"integer":"number";if(this.divisibleBy!==0&&this.divisibleBy!==1)json.divisibleBy=this.divisibleBy;if(this.minimum!==-Infinity){json.minimum=this.minimum;if(this.exclusiveMinimum===true)json.exclusiveMinimum=true}if(this.maximum!==Infinity){json.maximum=this.maximum;if(this.exclusiveMaximum===true)json.exclusiveMaximum=true}return json}});Schema.fromJSON.def(function(sch){if(!sch||sch.type!=="number"&&sch.type!=="integer")return;return new NumberSchema(sch.minimum,sch.exclusiveMinimum,sch.maximum,sch.exclusiveMaximum,sch.divisibleBy||(sch.type==="integer"?1:0))});Number.schema=(new NumberSchema).wrap();Number.min=Number.schema.min;Number.above=Number.schema.above;Number.max=Number.schema.max;Number.below=Number.schema.below;Number.step=Number.schema.step;Number.Integer=Number.step(1)});require.define("/lib/extensions/String.js",function(require,module,exports,__dirname,__filename,process,global){var RegexpSchema=require("../patterns/regexp");String.of=function(){var args=Array.prototype.slice.call(arguments).reverse(),charset=args[0]?"["+args[0]+"]":"[a-zA-Z0-9]",max=args[1],min=args.length>2?args[2]:args[1],regexp="^"+charset+"{"+(min||0)+","+(max||"")+"}$";return new RegexpSchema(RegExp(regexp)).wrap()};String.schema=(new RegexpSchema).wrap()});require.define("/lib/extensions/Object.js",function(require,module,exports,__dirname,__filename,process,global){var ReferenceSchema=require("../patterns/reference"),EqualitySchema=require("../patterns/equality"),ObjectSchema=require("../patterns/object");Object.like=function(other){return new EqualitySchema(other).wrap()};Object.reference=function(o){return new ReferenceSchema(o).wrap()};Object.schema=(new ObjectSchema).wrap()});require.define("/lib/extensions/Array.js",function(require,module,exports,__dirname,__filename,process,global){var Schema=require("../BaseSchema"),EqualitySchema=require("../patterns/equality"),anything=require("../patterns/anything").instance;var ArraySchema=module.exports=Schema.extensions.ArraySchema=Schema.extend({initialize:function(itemSchema,max,min){this.itemSchema=itemSchema||anything;this.min=min||0;this.max=max||Infinity},validate:function(instance){if(!(instance instanceof Array))return false;if(this.min===this.max){if(instance.length!==this.min)return false}else{if(this.min>0&&instance.length<this.min)return false;if(this.max<Infinity&&instance.length>this.max)return false}for(var i=0;i<instance.length;i++){if(!this.itemSchema.validate(instance[i]))return false}return true},toJSON:Schema.session(function(){var json=Schema.prototype.toJSON.call(this,true);if(json["$ref"]!=null)return json;json.type="array";if(this.min>0)json.minItems=this.min;if(this.max<Infinity)json.maxItems=this.max;if(this.itemSchema!==anything)json.items=this.itemSchema.toJSON();return json})});Schema.fromJSON.def(function(sch){if(!sch||sch.type!=="array")return;if(sch.items instanceof Array)return;return new ArraySchema(Schema.fromJSON(sch.items),sch.maxItems,sch.minItems)});Array.of=function(){var args=Array.prototype.slice.call(arguments).reverse();if(args.length===2)args[2]=args[1];return new ArraySchema(Schema.fromJS(args[0]),args[1],args[2]).wrap()};Array.like=function(other){return new EqualitySchema(other).wrap()};Array.schema=(new ArraySchema).wrap()});require.define("/lib/extensions/Function.js",function(require,module,exports,__dirname,__filename,process,global){var ReferenceSchema=require("../patterns/reference");Function.reference=function(f){return new ReferenceSchema(f).wrap()}});require.define("/lib/extensions/Schema.js",function(require,module,exports,__dirname,__filename,process,global){var Schema=require("../BaseSchema"),schema=require("../schema");var SchemaReference=module.exports=Schema.extensions.SchemaReference=Schema.extend({validate:function(){throw new Error("Trying to validate unresolved schema reference.")},resolve:function(schemaDescriptor){var schemaObject=Schema.fromJS(schemaDescriptor);for(var key in schemaObject){if(schemaObject[key]instanceof Function){this[key]=schemaObject[key].bind(schemaObject)}else{this[key]=schemaObject[key]}}delete this.resolve},publicFunctions:["resolve"]});schema.reference=function(schemaDescriptor){return new SchemaReference};function renewing(ref){ref.resolve=function(){Schema.self=schema.self=renewing(new SchemaReference);return SchemaReference.prototype.resolve.apply(this,arguments)};return ref}Schema.self=schema.self=renewing(new SchemaReference);Schema.fromJSON.def(function(sch){if(sch.id==null&&sch["$ref"]==null)return;var id,session=Schema.session;if(!session.deserialized)session.deserialized={references:{},subscribers:{}};if(sch.id!=null){id=sch.id;delete sch.id;var schemaObject=Schema.fromJSON(sch);sch.id=id;session.deserialized.references[id]=schemaObject;(session.deserialized.subscribers[id]||[]).forEach(function(callback){callback(schemaObject)});return schemaObject}else{id=sch["$ref"];if(session.deserialized.references[id])return session.deserialized.references[id];if(!session.deserialized.subscribers[id])session.deserialized.subscribers[id]=[];var reference=new SchemaReference;session.deserialized.subscribers[id].push(reference.resolve.bind(reference));return reference}})});require.define("/index.js",function(require,module,exports,__dirname,__filename,process,global){module.exports=require("./lib/schema");require("./lib/patterns/reference");require("./lib/patterns/nothing");require("./lib/patterns/anything");require("./lib/patterns/object");require("./lib/patterns/or");require("./lib/patterns/equality");require("./lib/patterns/regexp");require("./lib/patterns/class");require("./lib/patterns/schema");require("./lib/extensions/Boolean");require("./lib/extensions/Number");require("./lib/extensions/String");require("./lib/extensions/Object");require("./lib/extensions/Array");require("./lib/extensions/Function");require("./lib/extensions/Schema")});window.schema=require("/index.js")})();
Please sign in to comment.
Something went wrong with that request. Please try again.