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

joi-strict

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

joi-strict - npm Package Compare versions

Comparing version 1.0.11 to 1.1.0

24

lib/index.js

@@ -1,4 +0,24 @@

module.exports = require('@hapi/joi').defaults(schema => schema.options({
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
const JoiOriginal = require('@hapi/joi');
const assert = require('assert');
const Joi = JoiOriginal.defaults(schema => schema.options({
presence: 'required'
}));
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwicmVxdWlyZSIsImRlZmF1bHRzIiwic2NoZW1hIiwib3B0aW9ucyIsInByZXNlbmNlIl0sIm1hcHBpbmdzIjoiQUFBQUEsTUFBTSxDQUFDQyxPQUFQLEdBQWlCQyxPQUFPLENBQUMsV0FBRCxDQUFQLENBQXFCQyxRQUFyQixDQUErQkMsTUFBRCxJQUFZQSxNQUFNLENBQUNDLE9BQVAsQ0FBZTtBQUN4RUMsRUFBQUEsUUFBUSxFQUFFO0FBRDhELENBQWYsQ0FBMUMsQ0FBakIiLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJ0BoYXBpL2pvaScpLmRlZmF1bHRzKChzY2hlbWEpID0+IHNjaGVtYS5vcHRpb25zKHtcbiAgcHJlc2VuY2U6ICdyZXF1aXJlZCdcbn0pKTtcbiJdfQ==
assert(Joi.test === undefined);
module.exports = _objectSpread({
test: (object, schema) => {
if (!Joi.isSchema(schema)) {
throw new Error(`Not a Joi schema: ${typeof schema === 'string' ? schema : JSON.stringify(schema)}`);
}
return schema.validate(object).error === undefined;
}
}, Joi);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJKb2lPcmlnaW5hbCIsInJlcXVpcmUiLCJhc3NlcnQiLCJKb2kiLCJkZWZhdWx0cyIsInNjaGVtYSIsIm9wdGlvbnMiLCJwcmVzZW5jZSIsInRlc3QiLCJ1bmRlZmluZWQiLCJtb2R1bGUiLCJleHBvcnRzIiwib2JqZWN0IiwiaXNTY2hlbWEiLCJFcnJvciIsIkpTT04iLCJzdHJpbmdpZnkiLCJ2YWxpZGF0ZSIsImVycm9yIl0sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSxNQUFNQSxXQUFXLEdBQUdDLE9BQU8sQ0FBQyxXQUFELENBQTNCOztBQUNBLE1BQU1DLE1BQU0sR0FBR0QsT0FBTyxDQUFDLFFBQUQsQ0FBdEI7O0FBRUEsTUFBTUUsR0FBRyxHQUFHSCxXQUFXLENBQUNJLFFBQVosQ0FBc0JDLE1BQUQsSUFBWUEsTUFBTSxDQUFDQyxPQUFQLENBQWU7QUFDMURDLEVBQUFBLFFBQVEsRUFBRTtBQURnRCxDQ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IHNjaGVtYSA6IEpTT04uc3RyaW5naWZ5KHNjaGVtYSl9YCk7XG4gICAgfVxuICAgIHJldHVybiBzY2hlbWEudmFsaWRhdGUob2JqZWN0KS5lcnJvciA9PT0gdW5kZWZpbmVkO1xuICB9LFxuICAuLi5Kb2lcbn07XG4iXX0=

4

package.json
{
"name": "joi-strict",
"version": "1.0.11",
"version": "1.1.0",
"description": "Thin wrapper around joi that defaults to stricter validation.",

@@ -55,3 +55,3 @@ "main": "lib/index.js",

"eslint-plugin-mocha": "6.1.1",
"js-gardener": "2.0.84",
"js-gardener": "2.0.85",
"nyc": "14.1.1",

@@ -58,0 +58,0 @@ "semantic-release": "15.13.24"

@@ -26,2 +26,3 @@ # joi-strict

- Unknown object keys are not allowed unless explicitly market [unknown(true)](https://github.com/hapijs/joi/blob/v15.0.3/API.md#objectunknownallow).
- Additional function `Joi.test(object, schema)` to check if a schema matches an object

@@ -28,0 +29,0 @@ ## Usage

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