all files / lib/validators/ options.js

100% Statements 5/5
100% Branches 0/0
100% Functions 2/2
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108     658×                                                                                                                                                                                                          
(function() {
  var tv4;
 
  tv4 = require('tv4').tv4;
 
  module.exports = function(options) {
    return tv4.validateMultiple(options, {
      "type": "object",
      additionalProperties: false,
      properties: {
        thisValue: {
          required: false
        },
        globals: {
          type: 'array'
        },
        functionName: {
          type: 'string'
        },
        functionParameters: {
          type: ['array', 'undefined']
        },
        yieldAutomatically: {
          type: 'boolean'
        },
        yieldConditionally: {
          type: 'boolean'
        },
        executionCosts: {
          type: 'object'
        },
        executionLimit: {
          type: 'integer',
          minimum: 0,
          description: 'If given and non-zero, user code will throw execution exceeded errors after using too many statements.'
        },
        language: {
          type: 'string',
          description: "Input language",
          minLength: 1,
          'enum': ['javascript', 'coffeescript', 'python', 'lua', 'java']
        },
        languageVersion: {
          type: ['string', 'null', 'undefined']
        },
        problems: {
          type: ['object', 'undefined']
        },
        problemContext: {
          type: ['object', 'null', 'undefined']
        },
        includeFlow: {
          type: 'boolean',
          "default": true,
          description: "Whether to record control flow and variable values as user code executes."
        },
        noSerializationInFlow: {
          type: 'boolean',
          "default": false,
          description: "Whether to skip serializing variable values when recording variables in flow."
        },
        noVariablesInFlow: {
          type: 'boolean',
          "default": false,
          description: "Whether to skip capturing variable values at all when instrumenting flow."
        },
        skipDuplicateUserInfoInFlow: {
          type: 'boolean',
          "default": false,
          description: "Whether to skip recording calls with the same userInfo as the previous call when instrumenting flow."
        },
        includeMetrics: {
          type: 'boolean',
          "default": true
        },
        includeStyle: {
          type: 'boolean',
          "default": true
        },
        protectAPI: {
          type: ['boolean', 'null', 'undefined'],
          "default": false
        },
        simpleLoops: {
          type: 'boolean',
          "default": false,
          description: "Whether simple loops will be supported, per language.  E.g. 'loop()' will be transpiled as 'while(true)'."
        },
        protectBuiltins: {
          type: 'boolean',
          "default": true,
          description: 'Whether builtins will be protected and restored for enhanced security.'
        },
        whileTrueAutoYield: {
          type: 'boolean',
          "default": false,
          description: "Make while True loops automatically yield if no other yields"
        },
        useInterpreter: {
          type: ['boolean', 'null', 'undefined'],
          "default": true
        }
      }
    });
  };
 
}).call(this);