Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

joi

Package Overview
Dependencies
Maintainers
2
Versions
238
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

joi - npm Package Compare versions

Comparing version 4.8.1 to 4.9.0

.c9/metadata/workspace/.travis.yml

2

.c9/metadata/workspace/lib/date.js

@@ -1,1 +0,1 @@

{"filter":false,"title":"date.js","tooltip":"/lib/date.js","undoManager":{"mark":100,"position":100,"stack":[[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":13},"end":{"row":81,"column":14}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":14},"end":{"row":81,"column":15}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":15},"end":{"row":81,"column":16}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":16},"end":{"row":81,"column":17}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":17},"end":{"row":81,"column":18}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":18},"end":{"row":81,"column":19}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":81,"column":18},"end":{"row":81,"column":19}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":18},"end":{"row":81,"column":19}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":19},"end":{"row":81,"column":20}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":20},"end":{"row":81,"column":21}},"text":"n"},{"action":"insertText","range":{"start":{"row":81,"column":21},"end":{"row":81,"column":22}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":22},"end":{"row":81,"column":23}},"text":"w"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":81,"column":22},"end":{"row":81,"column":23}},"text":"w"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":81,"column":21},"end":{"row":81,"column":22}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":81,"column":20},"end":{"row":81,"column":21}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":20},"end":{"row":81,"column":21}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":21},"end":{"row":81,"column":22}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":22},"end":{"row":81,"column":23}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":23},"end":{"row":81,"column":24}},"text":"w"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":24},"end":{"row":81,"column":25}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":25},"end":{"row":81,"column":26}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":26},"end":{"row":81,"column":27}},"text":"?"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":27},"end":{"row":81,"column":28}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":28},"end":{"row":81,"column":29}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":81,"column":28},"end":{"row":81,"column":29}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":28},"end":{"row":81,"column":29}},"text":"d"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":29},"end":{"row":81,"column":30}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":30},"end":{"row":81,"column":31}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":31},"end":{"row":81,"column":32}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":32},"end":{"row":81,"column":33}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":33},"end":{"row":81,"column":34}},"text":":"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":34},"end":{"row":81,"column":35}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":80,"column":0},"end":{"row":81,"column":0}},"text":"\n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":0},"end":{"row":81,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":4},"end":{"row":81,"column":5}},"text":"v"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":5},"end":{"row":81,"column":6}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":6},"end":{"row":81,"column":7}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":7},"end":{"row":81,"column":8}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":8},"end":{"row":81,"column":9}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":9},"end":{"row":81,"column":10}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":10},"end":{"row":81,"column":11}},"text":"N"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":11},"end":{"row":81,"column":12}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":12},"end":{"row":81,"column":13}},"text":"w"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":13},"end":{"row":81,"column":14}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":14},"end":{"row":81,"column":15}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":15},"end":{"row":81,"column":16}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":82,"column":11},"end":{"row":82,"column":25}},"text":"date === 'now'"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":16},"end":{"row":81,"column":30}},"text":"date === 'now'"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":30},"end":{"row":81,"column":31}},"text":";"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":31},"end":{"row":82,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":82,"column":0},"end":{"row":82,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":82,"column":4},"end":{"row":83,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":83,"column":0},"end":{"row":83,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":83,"column":4},"end":{"row":83,"column":5}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":83,"column":5},"end":{"row":83,"column":6}},"text":"f"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":83,"column":6},"end":{"row":83,"column":7}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":83,"column":7},"end":{"row":83,"column":9}},"text":"()"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":83,"column":8},"end":{"row":83,"column":9}},"text":"!"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":83,"column":9},"end":{"row":83,"column":10}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":83,"column":10},"end":{"row":83,"column":11}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":83,"column":11},"end":{"row":83,"column":12}},"text":"N"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":83,"column":9},"end":{"row":83,"column":12}},"text":"isN"},{"action":"insertText","range":{"start":{"row":83,"column":9},"end":{"row":83,"column":14}},"text":"isNow"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":83,"column":15},"end":{"row":83,"column":16}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":83,"column":16},"end":{"row":83,"column":17}},"text":"{"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":83,"column":17},"end":{"row":84,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":84,"column":0},"end":{"row":85,"column":0}},"lines":[" "]},{"action":"insertText","range":{"start":{"row":85,"column":0},"end":{"row":85,"column":5}},"text":" }"}]}],[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":86,"column":0},"end":{"row":87,"column":0}},"nl":"\n","lines":[" date = ? date : internals.toDate(date);"]}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":84,"column":0},"end":{"row":84,"column":44}},"text":" date = ? date : internals.toDate(date);"},{"action":"insertText","range":{"start":{"row":84,"column":44},"end":{"row":85,"column":0}},"text":"\n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":84,"column":0},"end":{"row":84,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":85,"column":0},"end":{"row":85,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":85,"column":0},"end":{"row":86,"column":0}},"nl":"\n","lines":[" "]}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":84,"column":16},"end":{"row":84,"column":18}},"text":"? "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":84,"column":16},"end":{"row":84,"column":20}},"text":"date"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":84,"column":16},"end":{"row":84,"column":17}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":84,"column":16},"end":{"row":84,"column":17}},"text":":"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":84,"column":16},"end":{"row":84,"column":17}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":85,"column":5},"end":{"row":86,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":86,"column":0},"end":{"row":86,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":31},"end":{"row":91,"column":32}},"text":"("}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":46},"end":{"row":91,"column":47}},"text":")"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":32},"end":{"row":91,"column":33}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":33},"end":{"row":91,"column":34}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":34},"end":{"row":91,"column":35}},"text":"N"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":91,"column":32},"end":{"row":91,"column":35}},"text":"isN"},{"action":"insertText","range":{"start":{"row":91,"column":32},"end":{"row":91,"column":37}},"text":"isNow"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":37},"end":{"row":91,"column":38}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":38},"end":{"row":91,"column":39}},"text":"?"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":39},"end":{"row":91,"column":40}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":40},"end":{"row":91,"column":41}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":41},"end":{"row":91,"column":42}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":91,"column":41},"end":{"row":91,"column":42}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":91,"column":40},"end":{"row":91,"column":41}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":40},"end":{"row":91,"column":41}},"text":"D"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":41},"end":{"row":91,"column":42}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":42},"end":{"row":91,"column":43}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":43},"end":{"row":91,"column":44}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":44},"end":{"row":91,"column":45}},"text":"."}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":45},"end":{"row":91,"column":46}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":46},"end":{"row":91,"column":47}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":47},"end":{"row":91,"column":48}},"text":"w"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":48},"end":{"row":91,"column":49}},"text":"("}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":49},"end":{"row":91,"column":50}},"text":")"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":50},"end":{"row":91,"column":51}},"text":" "},{"action":"insertText","range":{"start":{"row":91,"column":51},"end":{"row":91,"column":52}},"text":":"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":91,"column":52},"end":{"row":91,"column":53}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":102,"column":0},"end":{"row":104,"column":0}},"nl":"\n","lines":[" date = internals.toDate(date);"," Hoek.assert(date, 'Invalid date format');"]},{"action":"insertText","range":{"start":{"row":102,"column":0},"end":{"row":102,"column":31}},"text":" var isNow = date === 'now';"},{"action":"insertText","range":{"start":{"row":102,"column":31},"end":{"row":103,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":103,"column":0},"end":{"row":109,"column":0}},"lines":[" "," if (!isNow) {"," date = internals.toDate(date);"," }"," "," Hoek.assert(date, 'Invalid date format');"]}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":112,"column":31},"end":{"row":112,"column":45}},"text":"date.getTime()"},{"action":"insertText","range":{"start":{"row":112,"column":31},"end":{"row":112,"column":68}},"text":"(isNow ? Date.now() : date.getTime())"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":82,"column":0},"end":{"row":82,"column":4}},"text":" "},{"action":"removeText","range":{"start":{"row":86,"column":0},"end":{"row":86,"column":4}},"text":" "},{"action":"removeText","range":{"start":{"row":103,"column":0},"end":{"row":103,"column":4}},"text":" "},{"action":"removeText","range":{"start":{"row":107,"column":0},"end":{"row":107,"column":4}},"text":" "}]}]]},"ace":{"folds":[],"scrolltop":1579.5,"scrollleft":0,"selection":{"start":{"row":112,"column":68},"end":{"row":112,"column":68},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":86,"state":"no_regex","mode":"ace/mode/javascript"}},"timestamp":1415531927767,"hash":"d81dae2c22a8b314858ca762f8396c170fc5ef5f"}
{"filter":false,"title":"date.js","tooltip":"/lib/date.js","undoManager":{"mark":-1,"position":-1,"stack":[]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":0,"column":0},"end":{"row":0,"column":0},"isBackwards":true},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1415531927767,"hash":"d81dae2c22a8b314858ca762f8396c170fc5ef5f"}

@@ -1,1 +0,1 @@

{"filter":false,"title":"README.md","tooltip":"/README.md","undoManager":{"mark":50,"position":50,"stack":[[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":441,"column":0},"end":{"row":442,"column":0}},"nl":"\n","lines":["<<<<<<< HEAD"]}]}],[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":452,"column":0},"end":{"row":453,"column":0}},"nl":"\n","lines":["======="]}]}],[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":461,"column":0},"end":{"row":462,"column":0}},"nl":"\n","lines":[">>>>>>> Added any.label method"]}]}],[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":450,"column":0},"end":{"row":451,"column":0}},"nl":"\n","lines":[""]}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":457,"column":13},"end":{"row":457,"column":14}},"text":"{"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":457,"column":14},"end":{"row":458,"column":0}},"text":"\n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":0},"end":{"row":458,"column":1}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":1},"end":{"row":458,"column":2}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":2},"end":{"row":458,"column":3}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":3},"end":{"row":458,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":40},"end":{"row":459,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":459,"column":0},"end":{"row":459,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":459,"column":4},"end":{"row":459,"column":5}},"text":"}"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":459,"column":5},"end":{"row":459,"column":6}},"text":";"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":459,"column":0},"end":{"row":459,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":4},"end":{"row":458,"column":5}},"text":"f"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":5},"end":{"row":458,"column":6}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":6},"end":{"row":458,"column":7}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":7},"end":{"row":458,"column":8}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":8},"end":{"row":458,"column":9}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":9},"end":{"row":458,"column":10}},"text":"_"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":10},"end":{"row":458,"column":11}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":11},"end":{"row":458,"column":12}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":12},"end":{"row":458,"column":13}},"text":"m"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":13},"end":{"row":458,"column":14}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":14},"end":{"row":458,"column":15}},"text":":"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":15},"end":{"row":458,"column":16}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":458,"column":20},"end":{"row":458,"column":29}},"text":"firstName"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":20},"end":{"row":458,"column":21}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":21},"end":{"row":458,"column":22}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":22},"end":{"row":458,"column":23}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":23},"end":{"row":458,"column":24}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":24},"end":{"row":458,"column":25}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":458,"column":25},"end":{"row":458,"column":26}},"text":"g"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":458,"column":48},"end":{"row":458,"column":49}},"text":";"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":183,"column":52},"end":{"row":183,"column":123}},"text":", when `'label'` is set, it overrides the key name in the error message"}]}],[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":36,"column":0},"end":{"row":37,"column":0}},"nl":"\n","lines":[" - [`any.label(name)`](#anylabelname)"]},{"action":"removeText","range":{"start":{"row":182,"column":52},"end":{"row":182,"column":123}},"text":", when `'label'` is set, it overrides the key name in the error message"},{"action":"removeLines","range":{"start":{"row":450,"column":0},"end":{"row":460,"column":0}},"nl":"\n","lines":["#### `any.label(name)`","","Overrides the key name in error messages.","- `name` - the name of the key.","","```javascript","var schema = {"," first_name: Joi.string().label('First Name')","};","```"]}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":36,"column":0},"end":{"row":36,"column":44}},"text":" - [`any.label(name)`](#anylabelname)"},{"action":"insertText","range":{"start":{"row":36,"column":44},"end":{"row":37,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":183,"column":52},"end":{"row":183,"column":123}},"text":", when `'label'` is set, it overrides the key name in the error message"},{"action":"insertText","range":{"start":{"row":451,"column":0},"end":{"row":451,"column":22}},"text":"#### `any.label(name)`"},{"action":"insertText","range":{"start":{"row":451,"column":22},"end":{"row":452,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":452,"column":0},"end":{"row":461,"column":0}},"lines":["","Overrides the key name in error messages.","- `name` - the name of the key.","","```javascript","var schema = {"," first_name: Joi.string().label('First Name')","};","```"]}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":612,"column":0},"end":{"row":612,"column":12}},"text":"<<<<<<< HEAD"},{"action":"insertText","range":{"start":{"row":612,"column":12},"end":{"row":613,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":628,"column":0},"end":{"row":628,"column":7}},"text":"======="},{"action":"insertText","range":{"start":{"row":628,"column":7},"end":{"row":629,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":629,"column":0},"end":{"row":634,"column":0}},"lines":["Note: `'now'` can be passed in lieu of `date` so as to always compare relatively to the current date, allowing to explicitly ensure a date is either in the past or in the future.","","```javascript","var schema = Joi.date().min('now');",">>>>>>> Enable to pass \"now\" in date.min and date.max"]}]}],[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":612,"column":0},"end":{"row":613,"column":0}},"nl":"\n","lines":["<<<<<<< HEAD"]}]}],[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":627,"column":0},"end":{"row":628,"column":0}},"nl":"\n","lines":["======="]}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":627,"column":0},"end":{"row":627,"column":3}},"text":"```"},{"action":"insertText","range":{"start":{"row":627,"column":3},"end":{"row":628,"column":0}},"text":"\n"}]}],[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":628,"column":0},"end":{"row":634,"column":0}},"nl":"\n","lines":["Note: `'now'` can be passed in lieu of `date` so as to always compare relatively to the current date, allowing to explicitly ensure a date is either in the past or in the future.","","```javascript","var schema = Joi.date().min('now');",">>>>>>> Enable to pass \"now\" in date.min and date.max","```"]}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":602,"column":0},"end":{"row":602,"column":178}},"text":"Note: `'now'` can be passed in lieu of `date` so as to always compare relatively to the current date, allowing to explicitly ensure a date is either in the past or in the future."},{"action":"insertText","range":{"start":{"row":602,"column":178},"end":{"row":603,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":603,"column":0},"end":{"row":608,"column":0}},"lines":["","```javascript","var schema = Joi.date().min('now');",">>>>>>> Enable to pass \"now\" in date.min and date.max","```"]}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":602,"column":0},"end":{"row":603,"column":0}},"text":"\n"}]}],[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":607,"column":0},"end":{"row":608,"column":0}},"nl":"\n","lines":[">>>>>>> Enable to pass \"now\" in date.min and date.max"]}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":618,"column":0},"end":{"row":618,"column":178}},"text":"Note: `'now'` can be passed in lieu of `date` so as to always compare relatively to the current date, allowing to explicitly ensure a date is either in the past or in the future."},{"action":"insertText","range":{"start":{"row":618,"column":178},"end":{"row":619,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":619,"column":0},"end":{"row":624,"column":0}},"lines":["","```javascript","var schema = Joi.date().min('now');","```",""]}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":621,"column":24},"end":{"row":621,"column":27}},"text":"min"},{"action":"insertText","range":{"start":{"row":621,"column":24},"end":{"row":621,"column":25}},"text":"m"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":621,"column":25},"end":{"row":621,"column":26}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":621,"column":26},"end":{"row":621,"column":27}},"text":"x"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":621,"column":0},"end":{"row":621,"column":32}},"text":"var schema = Joi.date().max('now"},{"action":"removeLines","range":{"start":{"row":603,"column":0},"end":{"row":621,"column":0}},"nl":"\n","lines":["Note: `'now'` can be passed in lieu of `date` so as to always compare relatively to the current date, allowing to explicitly ensure a date is either in the past or in the future.","","```javascript","var schema = Joi.date().min('now');","```","","#### `date.max(date)`","","Specifies the latest date allowed where:","- `date` - the latest date allowed.","","```javascript","var schema = Joi.date().max('12-31-2020');","```","","Note: `'now'` can be passed in lieu of `date` so as to always compare relatively to the current date, allowing to explicitly ensure a date is either in the past or in the future.","","```javascript"]},{"action":"insertText","range":{"start":{"row":603,"column":0},"end":{"row":603,"column":21}},"text":"#### `date.max(date)`"},{"action":"insertText","range":{"start":{"row":603,"column":21},"end":{"row":604,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":604,"column":0},"end":{"row":609,"column":0}},"lines":["","Specifies the latest date allowed where:","- `date` - the latest date allowed.","","```javascript"]},{"action":"insertText","range":{"start":{"row":609,"column":0},"end":{"row":609,"column":39}},"text":"var schema = Joi.date().max('12-31-2020"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":609,"column":0},"end":{"row":609,"column":39}},"text":"var schema = Joi.date().max('12-31-2020"},{"action":"removeLines","range":{"start":{"row":603,"column":0},"end":{"row":609,"column":0}},"nl":"\n","lines":["#### `date.max(date)`","","Specifies the latest date allowed where:","- `date` - the latest date allowed.","","```javascript"]},{"action":"insertText","range":{"start":{"row":603,"column":0},"end":{"row":603,"column":178}},"text":"Note: `'now'` can be passed in lieu of `date` so as to always compare relatively to the current date, allowing to explicitly ensure a date is either in the past or in the future."},{"action":"insertText","range":{"start":{"row":603,"column":178},"end":{"row":604,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":604,"column":0},"end":{"row":621,"column":0}},"lines":["","```javascript","var schema = Joi.date().min('now');","```","","#### `date.max(date)`","","Specifies the latest date allowed where:","- `date` - the latest date allowed.","","```javascript","var schema = Joi.date().max('12-31-2020');","```","","Note: `'now'` can be passed in lieu of `date` so as to always compare relatively to the current date, allowing to explicitly ensure a date is either in the past or in the future.","","```javascript"]},{"action":"insertText","range":{"start":{"row":621,"column":0},"end":{"row":621,"column":32}},"text":"var schema = Joi.date().max('now"}]}]]},"ace":{"folds":[],"scrolltop":10476,"scrollleft":0,"selection":{"start":{"row":602,"column":0},"end":{"row":602,"column":0},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":581,"state":"start","mode":"ace/mode/markdown"}},"timestamp":1415185440885,"hash":"a5b9dddabf3d8ae05a4a50ca6b4b0f5adf941b49"}
{"filter":false,"title":"README.md","tooltip":"/README.md","undoManager":{"mark":22,"position":22,"stack":[[{"group":"doc","deltas":[{"start":{"row":38,"column":25},"end":{"row":38,"column":30},"action":"remove","lines":["value"]},{"start":{"row":38,"column":25},"end":{"row":38,"column":26},"action":"insert","lines":["e"]}]}],[{"group":"doc","deltas":[{"start":{"row":38,"column":26},"end":{"row":38,"column":27},"action":"insert","lines":["n"]}]}],[{"group":"doc","deltas":[{"start":{"row":38,"column":27},"end":{"row":38,"column":28},"action":"insert","lines":["a"]}]}],[{"group":"doc","deltas":[{"start":{"row":38,"column":28},"end":{"row":38,"column":29},"action":"insert","lines":["b"]}]}],[{"group":"doc","deltas":[{"start":{"row":38,"column":29},"end":{"row":38,"column":30},"action":"insert","lines":["l"]}]}],[{"group":"doc","deltas":[{"start":{"row":38,"column":30},"end":{"row":38,"column":31},"action":"insert","lines":["e"]}]}],[{"group":"doc","deltas":[{"start":{"row":38,"column":31},"end":{"row":38,"column":32},"action":"insert","lines":["d"]}]}],[{"group":"doc","deltas":[{"start":{"row":38,"column":48},"end":{"row":38,"column":53},"action":"remove","lines":["value"]}]}],[{"group":"doc","deltas":[{"start":{"row":38,"column":48},"end":{"row":38,"column":49},"action":"insert","lines":["e"]}]}],[{"group":"doc","deltas":[{"start":{"row":38,"column":49},"end":{"row":38,"column":50},"action":"insert","lines":["n"]}]}],[{"group":"doc","deltas":[{"start":{"row":38,"column":50},"end":{"row":38,"column":51},"action":"insert","lines":["a"]}]}],[{"group":"doc","deltas":[{"start":{"row":38,"column":51},"end":{"row":38,"column":52},"action":"insert","lines":["b"]}]}],[{"group":"doc","deltas":[{"start":{"row":38,"column":52},"end":{"row":38,"column":53},"action":"insert","lines":["l"]}]}],[{"group":"doc","deltas":[{"start":{"row":38,"column":53},"end":{"row":38,"column":54},"action":"insert","lines":["e"]}]}],[{"group":"doc","deltas":[{"start":{"row":38,"column":54},"end":{"row":38,"column":55},"action":"insert","lines":["d"]}]}],[{"group":"doc","deltas":[{"start":{"row":477,"column":32},"end":{"row":477,"column":37},"action":"remove","lines":["value"]},{"start":{"row":477,"column":32},"end":{"row":477,"column":33},"action":"insert","lines":["e"]},{"start":{"row":475,"column":19},"end":{"row":475,"column":24},"action":"remove","lines":["value"]},{"start":{"row":475,"column":19},"end":{"row":475,"column":20},"action":"insert","lines":["e"]}]}],[{"group":"doc","deltas":[{"start":{"row":477,"column":33},"end":{"row":477,"column":34},"action":"insert","lines":["n"]},{"start":{"row":475,"column":20},"end":{"row":475,"column":21},"action":"insert","lines":["n"]}]}],[{"group":"doc","deltas":[{"start":{"row":477,"column":34},"end":{"row":477,"column":35},"action":"insert","lines":["a"]},{"start":{"row":475,"column":21},"end":{"row":475,"column":22},"action":"insert","lines":["a"]}]}],[{"group":"doc","deltas":[{"start":{"row":477,"column":35},"end":{"row":477,"column":36},"action":"insert","lines":["b"]},{"start":{"row":475,"column":22},"end":{"row":475,"column":23},"action":"insert","lines":["b"]}]}],[{"group":"doc","deltas":[{"start":{"row":477,"column":36},"end":{"row":477,"column":37},"action":"insert","lines":["l"]},{"start":{"row":475,"column":23},"end":{"row":475,"column":24},"action":"insert","lines":["l"]}]}],[{"group":"doc","deltas":[{"start":{"row":477,"column":37},"end":{"row":477,"column":38},"action":"insert","lines":["e"]},{"start":{"row":475,"column":24},"end":{"row":475,"column":25},"action":"insert","lines":["e"]}]}],[{"group":"doc","deltas":[{"start":{"row":477,"column":38},"end":{"row":477,"column":39},"action":"insert","lines":["d"]},{"start":{"row":475,"column":25},"end":{"row":475,"column":26},"action":"insert","lines":["d"]}]}],[{"group":"doc","deltas":[{"start":{"row":38,"column":0},"end":{"row":39,"column":0},"action":"remove","lines":[" - [`array.sparse(enabled)`](#arraysparseenabled)",""]},{"start":{"row":465,"column":58},"end":{"row":465,"column":158},"action":"remove","lines":[" Note that undefined values inside arrays are not allowed by default but can be by using `sparse()`."]},{"start":{"row":474,"column":0},"end":{"row":483,"column":0},"action":"remove","lines":["#### `array.sparse(enabled)`","","Allow this array to be sparse. `enabled` can be used with a falsy value to go back to the default behavior.","","```javascript","var schema = Joi.array().sparse(); // undefined values are now allowed","schema = schema.sparse(false); // undefined values are now denied","```","",""]}]}]]},"ace":{"folds":[],"scrolltop":7634.833927154541,"scrollleft":0,"selection":{"start":{"row":475,"column":0},"end":{"row":475,"column":0},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":457,"state":"jscode-start","mode":"ace/mode/markdown"}},"timestamp":1416252877680,"hash":"076bd672386ca6ec7222cfa8e4ba11891bc8b126"}

@@ -1,1 +0,1 @@

{"filter":false,"title":"alternatives.js","tooltip":"/test/alternatives.js","undoManager":{"mark":5,"position":5,"stack":[[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":3,"column":0},"end":{"row":3,"column":27}},"text":"var Code = require('code');"},{"action":"insertText","range":{"start":{"row":3,"column":27},"end":{"row":4,"column":0}},"text":"\n"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":20,"column":13},"end":{"row":20,"column":16}},"text":"Lab"},{"action":"insertText","range":{"start":{"row":20,"column":13},"end":{"row":20,"column":14}},"text":"C"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":20,"column":14},"end":{"row":20,"column":15}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":20,"column":15},"end":{"row":20,"column":16}},"text":"d"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":20,"column":16},"end":{"row":20,"column":17}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":3,"column":0},"end":{"row":4,"column":0}},"nl":"\n","lines":["var Code = require('code');"]}]}]]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":19,"column":17},"end":{"row":19,"column":17},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1415365344056,"hash":"bfdbf2d295e4ce901a3a09471d6167b31c503587"}
{"filter":false,"title":"alternatives.js","tooltip":"/test/alternatives.js","undoManager":{"mark":0,"position":-1,"stack":[]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":20,"column":25},"end":{"row":20,"column":25},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1416218382000,"hash":"133eeb46c87f4ed9015e0509e19c91816114f6fa"}

@@ -1,1 +0,1 @@

{"filter":false,"title":"array.js","tooltip":"/test/array.js","undoManager":{"mark":0,"position":0,"stack":[[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":3,"column":0},"end":{"row":3,"column":27}},"text":"var Code = require('code');"},{"action":"insertText","range":{"start":{"row":3,"column":27},"end":{"row":4,"column":0}},"text":"\n"}]}]]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":16,"column":4},"end":{"row":16,"column":10},"isBackwards":true},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1415365471618,"hash":"3b702776784fc846f18be4b04474ae1ab6e52d3a"}
{"filter":false,"title":"array.js","tooltip":"/test/array.js","undoManager":{"mark":0,"position":-1,"stack":[]},"ace":{"folds":[],"scrolltop":60,"scrollleft":0,"selection":{"start":{"row":16,"column":4},"end":{"row":16,"column":10},"isBackwards":true},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":2,"state":"start","mode":"ace/mode/javascript"}},"timestamp":1415365471618,"hash":"2a0d28e1d987c72c625911280278a4224e6cd1c7"}

@@ -1,1 +0,1 @@

{"filter":false,"title":"index.js","tooltip":"/test/index.js","undoManager":{"mark":0,"position":0,"stack":[[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":3,"column":0},"end":{"row":3,"column":27}},"text":"var Code = require('code');"},{"action":"insertText","range":{"start":{"row":3,"column":27},"end":{"row":4,"column":0}},"text":"\n"}]}]]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":4,"column":0},"end":{"row":4,"column":0},"isBackwards":true},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1415365552319,"hash":"82ca81b1fee963156664f2206cef4637c344434c"}
{"filter":false,"title":"index.js","tooltip":"/test/index.js","undoManager":{"mark":7,"position":7,"stack":[[{"group":"doc","deltas":[{"start":{"row":579,"column":34},"end":{"row":579,"column":36},"action":"insert","lines":["()"]},{"start":{"row":582,"column":38},"end":{"row":582,"column":40},"action":"insert","lines":["()"]},{"start":{"row":594,"column":50},"end":{"row":594,"column":52},"action":"insert","lines":["()"]},{"start":{"row":597,"column":54},"end":{"row":597,"column":56},"action":"insert","lines":["()"]},{"start":{"row":616,"column":34},"end":{"row":616,"column":36},"action":"insert","lines":["()"]},{"start":{"row":665,"column":38},"end":{"row":665,"column":40},"action":"insert","lines":["()"]},{"start":{"row":670,"column":42},"end":{"row":670,"column":44},"action":"insert","lines":["()"]},{"start":{"row":697,"column":38},"end":{"row":697,"column":40},"action":"insert","lines":["()"]},{"start":{"row":701,"column":46},"end":{"row":701,"column":48},"action":"insert","lines":["()"]},{"start":{"row":707,"column":46},"end":{"row":707,"column":48},"action":"insert","lines":["()"]},{"start":{"row":763,"column":34},"end":{"row":763,"column":36},"action":"insert","lines":["()"]},{"start":{"row":767,"column":38},"end":{"row":767,"column":40},"action":"insert","lines":["()"]},{"start":{"row":782,"column":34},"end":{"row":782,"column":36},"action":"insert","lines":["()"]},{"start":{"row":786,"column":38},"end":{"row":786,"column":40},"action":"insert","lines":["()"]},{"start":{"row":967,"column":34},"end":{"row":967,"column":36},"action":"insert","lines":["()"]},{"start":{"row":1070,"column":34},"end":{"row":1070,"column":36},"action":"insert","lines":["()"]},{"start":{"row":1113,"column":34},"end":{"row":1113,"column":36},"action":"insert","lines":["()"]},{"start":{"row":1134,"column":34},"end":{"row":1134,"column":36},"action":"insert","lines":["()"]},{"start":{"row":1139,"column":38},"end":{"row":1139,"column":40},"action":"insert","lines":["()"]},{"start":{"row":1162,"column":34},"end":{"row":1162,"column":36},"action":"insert","lines":["()"]},{"start":{"row":1167,"column":38},"end":{"row":1167,"column":40},"action":"insert","lines":["()"]}]}],[{"group":"doc","deltas":[{"start":{"row":1225,"column":39},"end":{"row":1225,"column":41},"action":"insert","lines":["()"]}]}],[{"group":"doc","deltas":[{"start":{"row":1225,"column":40},"end":{"row":1225,"column":40},"action":"insert","lines":[""]}]}],[{"group":"doc","deltas":[{"start":{"row":1225,"column":41},"end":{"row":1225,"column":42},"action":"insert","lines":[";"]}]}],[{"group":"doc","deltas":[{"start":{"row":1226,"column":40},"end":{"row":1226,"column":42},"action":"insert","lines":["()"]}]}],[{"group":"doc","deltas":[{"start":{"row":1226,"column":41},"end":{"row":1226,"column":41},"action":"insert","lines":[""]}]}],[{"group":"doc","deltas":[{"start":{"row":1226,"column":42},"end":{"row":1226,"column":43},"action":"insert","lines":[";"]}]}],[{"group":"doc","deltas":[{"start":{"row":579,"column":34},"end":{"row":579,"column":36},"action":"remove","lines":["()"]},{"start":{"row":580,"column":0},"end":{"row":580,"column":0},"action":"insert","lines":[""]},{"start":{"row":582,"column":38},"end":{"row":582,"column":40},"action":"remove","lines":["()"]},{"start":{"row":594,"column":50},"end":{"row":594,"column":52},"action":"remove","lines":["()"]},{"start":{"row":597,"column":54},"end":{"row":597,"column":56},"action":"remove","lines":["()"]},{"start":{"row":616,"column":34},"end":{"row":616,"column":36},"action":"remove","lines":["()"]},{"start":{"row":665,"column":38},"end":{"row":665,"column":40},"action":"remove","lines":["()"]},{"start":{"row":670,"column":42},"end":{"row":670,"column":44},"action":"remove","lines":["()"]},{"start":{"row":697,"column":38},"end":{"row":697,"column":40},"action":"remove","lines":["()"]},{"start":{"row":701,"column":46},"end":{"row":701,"column":48},"action":"remove","lines":["()"]},{"start":{"row":707,"column":46},"end":{"row":707,"column":48},"action":"remove","lines":["()"]},{"start":{"row":763,"column":34},"end":{"row":763,"column":36},"action":"remove","lines":["()"]},{"start":{"row":767,"column":38},"end":{"row":767,"column":40},"action":"remove","lines":["()"]},{"start":{"row":782,"column":34},"end":{"row":782,"column":36},"action":"remove","lines":["()"]},{"start":{"row":786,"column":38},"end":{"row":786,"column":40},"action":"remove","lines":["()"]},{"start":{"row":967,"column":34},"end":{"row":967,"column":36},"action":"remove","lines":["()"]},{"start":{"row":1070,"column":34},"end":{"row":1070,"column":36},"action":"remove","lines":["()"]},{"start":{"row":1113,"column":34},"end":{"row":1113,"column":36},"action":"remove","lines":["()"]},{"start":{"row":1134,"column":34},"end":{"row":1134,"column":36},"action":"remove","lines":["()"]},{"start":{"row":1139,"column":38},"end":{"row":1139,"column":40},"action":"remove","lines":["()"]},{"start":{"row":1162,"column":34},"end":{"row":1162,"column":36},"action":"remove","lines":["()"]},{"start":{"row":1167,"column":38},"end":{"row":1167,"column":40},"action":"remove","lines":["()"]},{"start":{"row":1225,"column":39},"end":{"row":1225,"column":42},"action":"remove","lines":["();"]},{"start":{"row":1226,"column":40},"end":{"row":1226,"column":43},"action":"remove","lines":["();"]}]}]]},"ace":{"folds":[],"scrolltop":20239.668224334717,"scrollleft":0,"selection":{"start":{"row":1226,"column":40},"end":{"row":1226,"column":40},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":342,"state":"start","mode":"ace/mode/javascript"}},"timestamp":1416252619504,"hash":"3d0e779687e0a732014ca99bdb18192738d5ae38"}

@@ -1,1 +0,1 @@

{"filter":false,"title":"ref.js","tooltip":"/test/ref.js","undoManager":{"mark":0,"position":0,"stack":[[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":3,"column":0},"end":{"row":3,"column":27}},"text":"var Code = require('code');"},{"action":"insertText","range":{"start":{"row":3,"column":27},"end":{"row":4,"column":0}},"text":"\n"}]}]]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":4,"column":0},"end":{"row":4,"column":0},"isBackwards":true},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1415365554599,"hash":"4c971f7326584e4a067f3f1d6a7ede4bff99e8bf"}
{"filter":false,"title":"ref.js","tooltip":"/test/ref.js","undoManager":{"mark":2,"position":2,"stack":[[{"group":"doc","deltas":[{"start":{"row":355,"column":52},"end":{"row":355,"column":54},"action":"insert","lines":["()"]}]}],[{"group":"doc","deltas":[{"start":{"row":355,"column":53},"end":{"row":355,"column":53},"action":"insert","lines":[""]}]}],[{"group":"doc","deltas":[{"start":{"row":355,"column":52},"end":{"row":355,"column":54},"action":"remove","lines":["()"]}]}]]},"ace":{"folds":[],"scrolltop":5720.16711807251,"scrollleft":0,"selection":{"start":{"row":355,"column":52},"end":{"row":355,"column":52},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":342,"state":"start","mode":"ace/mode/javascript"}},"timestamp":1416252630421,"hash":"c2e3bbcb46a736408d213db793eb4b6b3612cacf"}

@@ -66,3 +66,4 @@ // Load modules

override: 'cannot rename child {{from}} because override is disabled and target {{to}} exists'
}
},
type: 'must be an instance of {{type}}'
},

@@ -69,0 +70,0 @@ number: {

@@ -596,2 +596,18 @@ // Load modules

internals.Object.prototype.type = function (constructor, name) {
Hoek.assert(typeof constructor === 'function', 'type must be a constructor function');
name = name || constructor.name;
return this._test('type', name, function (value, state, options) {
if (value instanceof constructor) {
return null;
}
return Errors.create('object.type', { type: name }, state, options);
});
};
module.exports = new internals.Object();
{
"name": "joi",
"description": "Object schema validation",
"version": "4.8.1",
"version": "4.9.0",
"repository": "git://github.com/hapijs/joi",

@@ -6,0 +6,0 @@ "main": "index",

@@ -79,2 +79,3 @@ ![joi Logo](https://raw.github.com/hapijs/joi/master/images/joi.png)

- [`object.unknown([allow])`](#objectunknownallow)
- [`object.type(constructor, [name])`](#objecttypeconstructorname)
- [`string`](#string)

@@ -922,2 +923,12 @@ - [`string.insensitive()`](#stringinsensitive)

#### `object.type(constructor, [name])`
Requires the object to be an instance of a given constructor where:
- `constructor` - the constructor function that the object must be an instance of.
- `name` - an alternate name to use in validation errors. This is useful when the constructor function does not have a name.
```javascript
var schema = Joi.object().type(RegExp);
```
### `string`

@@ -924,0 +935,0 @@

@@ -30,3 +30,3 @@ // Load modules

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('value not matching any of the allowed alternatives');

@@ -41,3 +41,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -58,3 +58,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.a).to.equal(5);

@@ -76,3 +76,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.a).to.equal(5);

@@ -95,3 +95,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.a.b).to.equal('any');

@@ -98,0 +98,0 @@ done();

@@ -84,3 +84,3 @@ // Load modules

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.b).to.equal(2);

@@ -100,3 +100,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(err.details[0].message).to.equal('Custom label must be a valid email');

@@ -125,3 +125,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(value.b).to.equal('2');

@@ -142,3 +142,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.foo).to.equal('test');

@@ -156,3 +156,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.foo).to.equal('test');

@@ -172,3 +172,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.b).to.equal(false);

@@ -188,3 +188,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.b).to.equal(false);

@@ -398,3 +398,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -629,3 +629,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value).to.deep.equal({ a: 1, b: 2 });

@@ -643,3 +643,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -646,0 +646,0 @@ });

@@ -30,3 +30,3 @@ // Load modules

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.length).to.equal(3);

@@ -41,3 +41,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('value must be an array');

@@ -52,3 +52,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(value).to.equal(3);

@@ -63,3 +63,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(value).to.equal('3');

@@ -74,3 +74,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(value).to.equal('asdf');

@@ -89,3 +89,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value).to.deep.equal([1, 2, 3]);

@@ -107,3 +107,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -275,3 +275,3 @@ });

expect(err).to.exist;
expect(err).to.exist();

@@ -281,3 +281,3 @@ var m = ['x', 'y', 'z'];

expect(err2).to.not.exist;
expect(err2).to.not.exist();
done();

@@ -334,3 +334,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('arr position 2 fails because 2 must be an integer');

@@ -371,3 +371,3 @@ done();

var desc = schema.describe();
expect(desc.includes).to.not.exist;
expect(desc.includes).to.not.exist();
done();

@@ -374,0 +374,0 @@ });

@@ -30,3 +30,3 @@ // Load modules

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value instanceof Buffer).to.equal(true);

@@ -60,3 +60,3 @@ expect(value.length).to.equal(4);

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('value must be a buffer or a string');

@@ -75,3 +75,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.toString('utf8')).to.equal('hello world');

@@ -91,3 +91,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value instanceof Buffer).to.equal(true);

@@ -94,0 +94,0 @@ expect(value.toString()).to.equal('abcdef');

@@ -30,3 +30,3 @@ // Load modules

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value).to.equal(true);

@@ -41,3 +41,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(value).to.equal(1);

@@ -44,0 +44,0 @@ done();

@@ -40,3 +40,3 @@ // Load modules

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -50,3 +50,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('value must be a number of milliseconds or valid date string');

@@ -61,3 +61,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -74,3 +74,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value).to.deep.equal(now);

@@ -87,3 +87,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value).to.deep.equal(future);

@@ -100,3 +100,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -112,3 +112,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value).to.deep.equal(past);

@@ -125,3 +125,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -128,0 +128,0 @@ });

@@ -75,3 +75,3 @@ // Load modules

expect(err).to.exist;
expect(err).to.exist();
expect(err.name).to.equal('ValidationError');

@@ -126,3 +126,3 @@ expect(err.message).to.equal('value 11. required 7. xor 7. email 19. date 18. alphanum 16. min 14. max 15. notEmpty 3');

expect(err).to.exist;
expect(err).to.exist();
expect(err.details).to.have.length(3);

@@ -146,3 +146,3 @@ expect(err.details[0].type).to.equal('number.base');

expect(err).to.exist;
expect(err).to.exist();
expect(err.details[0].path).to.equal('1.1.x');

@@ -163,3 +163,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(err.details[0].path).to.equal('1.1');

@@ -182,3 +182,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(err.details[0].path).to.equal('x.1.x');

@@ -234,3 +234,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(err.annotate()).to.equal('{\n \"y\": {\n \"b\" \u001b[31m[1]\u001b[0m: {\n \"c\": 10\n },\n \u001b[41m\"u\"\u001b[0m\u001b[31m [2]: -- missing --\u001b[0m\n },\n \"a\" \u001b[31m[3]\u001b[0m: \"m\"\n}\n\u001b[31m\n[1] a must be one of a, b, c, d\n[2] u is required\n[3] b must be a string\u001b[0m');

@@ -253,3 +253,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(err.annotate()).to.equal('{\n \"x\" \u001b[31m[1, 2, 3]\u001b[0m: true\n}\n\u001b[31m\n[1] x must be a string\n[2] x must be a number\n[3] x must be a number of milliseconds or valid date string\u001b[0m');

@@ -256,0 +256,0 @@ done();

@@ -43,3 +43,3 @@ // Load modules

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -73,3 +73,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
expect(err.annotate()).to.equal('{\n \u001b[41m\"value\"\u001b[0m\u001b[31m [1]: -- missing --\u001b[0m\n}\n\u001b[31m\n[1] value must be a string\u001b[0m');

@@ -158,6 +158,6 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
Joi.compile(/.{2}/).validate('6', function (err, value) {
expect(err).to.exist;
expect(err).to.exist();
done();

@@ -411,3 +411,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('mode must be one of required, optional, try, null. auth must be a string. auth must be a boolean');

@@ -442,3 +442,3 @@

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('mode must be one of required, optional, try, null. auth must be a string. auth must be a boolean');

@@ -535,3 +535,3 @@

expect(err).to.exist;
expect(err).to.exist();
expect(value.a).to.equal('5');

@@ -552,3 +552,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.hasOwnProperty('a')).to.equal(false);

@@ -578,3 +578,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -588,6 +588,6 @@ });

expect(err).to.be.null;
expect(err).to.be.null();
Joi.object().validate({ auth: { mode: 'try' } }, function (err, value) {
expect(err).to.be.null;
expect(err).to.be.null();

@@ -604,6 +604,6 @@ Joi.object().validate(true, function (err, value) {

expect(err).to.be.null;
expect(err).to.be.null();
Joi.object({ param: Joi.string().required() }).validate({ param: 'item' }, function (err, value) {
expect(err).to.be.null;
expect(err).to.be.null();
done();

@@ -627,3 +627,3 @@ });

expect(err).to.be.null;
expect(err).to.be.null();
expect(value.a).to.equal(5);

@@ -639,3 +639,3 @@ expect(input.a).to.equal('5');

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -649,3 +649,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('foo is not allowed');

@@ -655,3 +655,3 @@

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('foo is not allowed');

@@ -661,3 +661,3 @@

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('foo is not allowed');

@@ -681,3 +681,3 @@

expect(err).to.not.be.null;
expect(err).to.not.be.null();
expect(err.message).to.contain('unknown is not allowed');

@@ -687,3 +687,3 @@

expect(err).to.not.be.null;
expect(err).to.not.be.null();
expect(err.message).to.contain('something is not allowed');

@@ -710,3 +710,3 @@

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.contain('module is required');

@@ -716,7 +716,7 @@

expect(err).to.be.null;
expect(err).to.be.null();
Joi.compile(config).validate({ module: {} }, function (err, value) {
expect(err).to.not.be.null;
expect(err).to.not.be.null();
expect(err.message).to.contain('compile is required');

@@ -727,3 +727,3 @@ expect(err.message).to.contain('module must be a string');

expect(err).to.be.null;
expect(err).to.be.null();
done();

@@ -750,3 +750,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -770,3 +770,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.contain('module is required');

@@ -786,7 +786,7 @@ done();

expect(err).to.be.null;
expect(err).to.be.null();
Joi.compile(config).validate({ position: 1 }, function (err, value) {
expect(err).to.be.null;
expect(err).to.be.null();
done();

@@ -806,7 +806,7 @@ })

expect(err).to.be.null;
expect(err).to.be.null();
Joi.compile(config).validate({ position: 1 }, function (err, value) {
expect(err).to.be.null;
expect(err).to.be.null();
done();

@@ -831,3 +831,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -852,3 +852,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -874,3 +874,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -896,3 +896,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -910,3 +910,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -924,3 +924,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -938,3 +938,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -958,3 +958,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(input.a).to.equal('{"b":"string"}');

@@ -974,3 +974,3 @@ expect(value.a.b).to.equal('string');

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -988,3 +988,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -1002,3 +1002,3 @@ });

expect(err).to.be.null;
expect(err).to.be.null();
done();

@@ -1016,3 +1016,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -1036,3 +1036,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -1056,3 +1056,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -1075,3 +1075,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -1089,3 +1089,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -1111,3 +1111,3 @@ });

expect(err).to.be.null;
expect(err).to.be.null();
expect(value).to.deep.equal({ a: 1, b: 'a' });

@@ -1134,3 +1134,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -1156,3 +1156,3 @@ });

expect(err).to.be.null;
expect(err).to.be.null();
expect(value).to.deep.equal({ a: 1, b: 'a', d: 'c' });

@@ -1178,3 +1178,3 @@ done();

expect(err).to.be.null;
expect(err).to.be.null();
expect(value).to.deep.equal({ a: 1, b: 'a', d: 'c' });

@@ -1184,3 +1184,3 @@

expect(err).to.be.null;
expect(err).to.be.null();
expect(value).to.deep.equal({ a: 1, b: 'a', d: 'c' });

@@ -1208,3 +1208,3 @@ done();

expect(err).to.be.null;
expect(err).to.be.null();
expect(value).to.deep.equal({ a: 1, b: 'a' });

@@ -1214,3 +1214,3 @@

expect(err).to.be.null;
expect(err).to.be.null();
expect(value).to.deep.equal({ a: 1, b: 'a' });

@@ -1228,3 +1228,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -1241,3 +1241,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.contain('func is not allowed');

@@ -1257,3 +1257,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -1276,4 +1276,4 @@ });

expect(errOne).to.exist
expect(errFull).to.exist
expect(errOne).to.exist();
expect(errFull).to.exist();
expect(errFull.details.length).to.be.greaterThan(errOne.details.length);

@@ -1290,3 +1290,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -1300,3 +1300,3 @@ });

var result = any.validate('abc');
expect(result.error).to.not.exist;
expect(result.error).to.not.exist();
expect(result.value).to.equal('abc');

@@ -1310,3 +1310,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -1319,3 +1319,3 @@ });

var result = Joi.validate('test', Joi.string());
expect(result.error).to.not.exist;
expect(result.error).to.not.exist();
expect(result.value).to.equal('test');

@@ -1329,3 +1329,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -1338,3 +1338,3 @@ });

var result = Joi.validate('5', Joi.number(), { convert: false });
expect(result.error).to.exist;
expect(result.error).to.exist();
done();

@@ -1347,3 +1347,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -1357,3 +1357,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -1493,3 +1493,3 @@ });

var description = Joi.allow(null).describe();
expect(description.invalids).to.not.exist;
expect(description.invalids).to.not.exist();
done();

@@ -1496,0 +1496,0 @@ })

@@ -56,3 +56,3 @@ // Load modules

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -107,3 +107,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.a).to.equal(123);

@@ -118,3 +118,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value).to.equal(1);

@@ -129,3 +129,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(value).to.equal(null);

@@ -486,3 +486,3 @@ done();

var result = Joi.number().min(5);
expect(result.valueOf()).to.exist;
expect(result.valueOf()).to.exist();
done();

@@ -522,3 +522,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value).to.equal(input);

@@ -525,0 +525,0 @@ done();

@@ -30,3 +30,3 @@ // Load modules

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.hi).to.equal(true);

@@ -41,3 +41,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(value).to.equal('a string');

@@ -97,7 +97,7 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
Joi.object(undefined).validate({ a: 4 }, function (err, value) {
expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -112,3 +112,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -140,4 +140,4 @@ });

expect(err).to.not.exist;
expect(value).to.not.exist;
expect(err).to.not.exist();
expect(value).to.not.exist();
done();

@@ -151,3 +151,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -212,2 +212,14 @@ });

it('should validate constructor when type is set', function (done) {
var schema = Joi.object().type(RegExp);
Helper.validate(schema, [
[{ item: 'something' }, false],
['', false],
[new Date(), false],
[/abcd/, true],
[new RegExp(), true]
], done);
});
it('should traverse an object and validate all properties in the top level', function (done) {

@@ -318,3 +330,3 @@

expect(err).to.exist;
expect(err).to.exist();
done();

@@ -344,6 +356,6 @@ });

expect(err).to.exist;
expect(err).to.exist();
b.validate({ b: 3 }, function (err, value) {
expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -360,6 +372,6 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
b.validate({ b: 3 }, function (err, value) {
expect(err).to.exist;
expect(err).to.exist();
done();

@@ -376,6 +388,6 @@ });

expect(err).to.exist;
expect(err).to.exist();
b.validate({ a: 1, b: 2 }, function (err, value) {
expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -432,3 +444,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -455,3 +467,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('value cannot rename child c because multiple renames are disabled and another key was already renamed to b. value cannot rename child d because multiple renames are disabled and another key was already renamed to b');

@@ -473,3 +485,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.a).to.equal(10);

@@ -502,3 +514,3 @@ expect(value.b).to.equal(10);

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -520,3 +532,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.arr[0].one).to.equal('1');

@@ -538,4 +550,4 @@ expect(value.arr[0].two).to.equal('2');

expect(err1).to.not.exist;
expect(value1.b).to.not.exist;
expect(err1).to.not.exist();
expect(value1.b).to.not.exist();
expect(value1.a).to.equal(5);

@@ -548,4 +560,4 @@

expect(err2).to.not.exist;
expect(value2.b).to.not.exist;
expect(err2).to.not.exist();
expect(value2.b).to.not.exist();
expect(value2.a).to.equal(5);

@@ -568,3 +580,3 @@

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value.foo2).to.equal('test');

@@ -585,4 +597,4 @@

expect(err).to.not.exist;
expect(value['']).to.not.exist;
expect(err).to.not.exist();
expect(value['']).to.not.exist();
expect(value.notEmpty).to.equal('something');

@@ -603,3 +615,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(Object.keys(value)).to.include('a');

@@ -713,3 +725,3 @@ expect(value.a).to.equal('something');

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('5 must be a boolean. bb must be one of x');

@@ -739,3 +751,3 @@

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('5 must be a boolean. bb must be one of x');

@@ -752,3 +764,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('a is not allowed');

@@ -765,3 +777,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -899,3 +911,3 @@ });

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('value must contain at least one of x, y');

@@ -923,3 +935,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('value validation failed because d.e failed to equal to a.c');

@@ -947,3 +959,3 @@

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('value validation failed because d.e failed to equal to a.c');

@@ -1009,3 +1021,3 @@

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('value validation failed because d.e failed to pass the assertion test');

@@ -1016,2 +1028,61 @@ done();

});
describe('#type', function () {
it('uses constructor name for default type name', function (done) {
function Foo () {}
var schema = Joi.object().type(Foo);
schema.validate({}, function (err) {
expect(err).to.exist();
expect(err.message).to.equal('value must be an instance of Foo');
done();
});
});
it('uses custom type name if supplied', function (done) {
var Foo = function () {};
var schema = Joi.object().type(Foo, 'Bar');
schema.validate({}, function (err) {
expect(err).to.exist();
expect(err.message).to.equal('value must be an instance of Bar');
done();
});
});
it('overrides constructor name with custom name', function (done) {
function Foo () {}
var schema = Joi.object().type(Foo, 'Bar');
schema.validate({}, function (err) {
expect(err).to.exist();
expect(err.message).to.equal('value must be an instance of Bar');
done();
});
});
it('throws when constructor is not a function', function (done) {
expect(function () {
var schema = Joi.object().type('');
}).to.throw('type must be a constructor function');
done();
});
it('uses the constructor name in the schema description', function (done) {
var description = Joi.object().type(RegExp).describe();
expect(description.rules).to.deep.include({ name: 'type', arg: 'RegExp' });
done();
});
});
});

@@ -35,3 +35,3 @@ // Load modules

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('a must be one of ref:b');

@@ -57,3 +57,3 @@

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('a must be one of ref:');

@@ -81,3 +81,3 @@

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('a must be one of ref:b.c');

@@ -109,3 +109,3 @@

expect(err).to.not.exist;
expect(err).to.not.exist();

@@ -118,3 +118,3 @@ var parent = Joi.object({

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -139,3 +139,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -156,3 +156,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();

@@ -168,3 +168,3 @@ var ba = Joi.object({

expect(err).to.not.exist;
expect(err).to.not.exist();
done();

@@ -184,3 +184,3 @@ });

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value).to.deep.equal({ a: 6, b: 6 });

@@ -200,3 +200,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value).to.deep.equal({ a: 6, b: 6 });

@@ -211,3 +211,3 @@

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value).to.deep.equal({ a: 6, b: 6 });

@@ -277,3 +277,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value).to.deep.equal({ a: 22, b: 6 });

@@ -293,3 +293,3 @@ done();

expect(err).to.not.exist;
expect(err).to.not.exist();
expect(value).to.deep.equal({ a: 22, b: 6 });

@@ -309,3 +309,3 @@ done();

expect(err).to.exist;
expect(err).to.exist();
expect(err.message).to.equal('a must be one of context:x');

@@ -370,3 +370,3 @@

var desc = Joi.compile(Joi.ref('a.b')).describe();
expect(Joi.isRef(desc.valids[0])).to.be.true;
expect(Joi.isRef(desc.valids[0])).to.be.true();
done();

@@ -373,0 +373,0 @@ });

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc