BVB Source Codes

reactide Show .tonic_example.js Source code

Return Download reactide: download .tonic_example.js Source code - Download reactide Source code - Type:.js
  1. var Ajv = require('ajv');
  2. var ajv = Ajv({allErrors: true});
  3.  
  4. var schema = {
  5.   "properties": {
  6.     "foo": { "type": "string" },
  7.     "bar": { "type": "number", "maximum": 3 }
  8.   }
  9. };
  10.  
  11. var validate = ajv.compile(schema);
  12.  
  13. test({"foo": "abc", "bar": 2});
  14. test({"foo": 2, "bar": 4});
  15.  
  16. function test(data) {
  17.   var valid = validate(data);
  18.   if (valid) console.log('Valid!');
  19.   else console.log('Invalid: ' + ajv.errorsText(validate.errors));
  20. }
download.tonic_example.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top