PHP 8.2.30
Preview: runner.js Size: 590 B
/opt/alt/alt-nodejs6/root/lib/node_modules/npm/node_modules/request/node_modules/har-validator/lib/runner.js

'use strict'

var schemas = require('./schemas')
var ValidationError = require('./error')
var validator = require('is-my-json-valid')

module.exports = function (schema, data, cb) {
  // default value
  var valid = false

  // validator config
  var validate = validator(schema, {
    greedy: true,
    verbose: true,
    schemas: schemas
  })

  // execute is-my-json-valid
  if (data !== undefined) {
    valid = validate(data)
  }

  // callback?
  if (typeof cb === 'function') {
    return cb(validate.errors ? new ValidationError(validate.errors) : null, valid)
  }

  return valid
}

Directory Contents

Dirs: 1 × Files: 4

Name Size Perms Modified Actions
schemas DIR
- drwxr-xr-x 2024-03-03 22:41:43
Edit Download
304 B lrw-r--r-- 2021-09-28 09:36:06
Edit Download
186 B lrw-r--r-- 2021-09-28 09:36:06
Edit Download
554 B lrw-r--r-- 2021-09-28 09:36:06
Edit Download
590 B lrw-r--r-- 2021-09-28 09:36:06
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).