From 38955c646db676bedcae47fc4e2c80ad22c56af5 Mon Sep 17 00:00:00 2001 From: Joel Date: Sun, 30 Sep 2018 15:04:47 -0700 Subject: [PATCH] Issue #334: Upgrade joi dependency to 13.7.0 for release of 2.7.0 --- lib/joi/VERSION | 2 +- lib/joi/joi.bundle.js | 148 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 131 insertions(+), 19 deletions(-) diff --git a/lib/joi/VERSION b/lib/joi/VERSION index fc9c00c1..d6ef9982 100644 --- a/lib/joi/VERSION +++ b/lib/joi/VERSION @@ -1 +1 @@ -13.6.0 +13.7.0 diff --git a/lib/joi/joi.bundle.js b/lib/joi/joi.bundle.js index 6164b9d9..012c6d4a 100644 --- a/lib/joi/joi.bundle.js +++ b/lib/joi/joi.bundle.js @@ -82,7 +82,7 @@ module.exports = /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 5); +/******/ return __webpack_require__(__webpack_require__.s = 6); /******/ }) /************************************************************************/ /******/ ([ @@ -97,7 +97,7 @@ module.exports = const Assert = __webpack_require__(13); const Crypto = __webpack_require__(14); const Path = __webpack_require__(15); -const Util = __webpack_require__(6); +const Util = __webpack_require__(4); const Escape = __webpack_require__(16); @@ -1058,7 +1058,7 @@ exports.block = function () { const Hoek = __webpack_require__(0); const Settings = __webpack_require__(7); const Ref = __webpack_require__(2); -const Errors = __webpack_require__(4); +const Errors = __webpack_require__(5); let Alternatives = null; // Delay-loaded to prevent circular dependencies let Cast = null; @@ -2075,6 +2075,12 @@ exports.ref = function (id) { /***/ }), /* 4 */ +/***/ (function(module, exports) { + +module.exports = require("util"); + +/***/ }), +/* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2444,7 +2450,7 @@ internals.annotate = function (stripColorCodes) { /***/ }), -/* 5 */ +/* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2455,7 +2461,7 @@ internals.annotate = function (stripColorCodes) { const Hoek = __webpack_require__(0); const Any = __webpack_require__(1); const Cast = __webpack_require__(3); -const Errors = __webpack_require__(4); +const Errors = __webpack_require__(5); const Lazy = __webpack_require__(19); const Ref = __webpack_require__(2); const Settings = __webpack_require__(7); @@ -2472,7 +2478,8 @@ const internals = { func: __webpack_require__(23), number: __webpack_require__(25), object: __webpack_require__(11), - string: __webpack_require__(26) + string: __webpack_require__(26), + symbol: __webpack_require__(32) }; internals.callWithDefaults = function (schema, args) { @@ -2562,6 +2569,13 @@ internals.root = function () { return internals.callWithDefaults.call(this, internals.string, args); }; + root.symbol = function (...args) { + + Hoek.assert(args.length === 0, 'Joi.symbol() does not allow arguments.'); + + return internals.callWithDefaults.call(this, internals.symbol, args); + }; + root.ref = function (...args) { return Ref.create(...args); @@ -2880,7 +2894,7 @@ internals.root = function () { root.extensionsSchema = internals.array.items([internals.object, internals.func.arity(1)]).strict(); - root.version = __webpack_require__(32).version; + root.version = __webpack_require__(33).version; return root; }; @@ -2889,12 +2903,6 @@ internals.root = function () { module.exports = internals.root(); -/***/ }), -/* 6 */ -/***/ (function(module, exports) { - -module.exports = require("util"); - /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { @@ -3520,7 +3528,7 @@ module.exports = new internals.Date(); const Hoek = __webpack_require__(0); const Topo = __webpack_require__(24); const Any = __webpack_require__(1); -const Errors = __webpack_require__(4); +const Errors = __webpack_require__(5); const Cast = __webpack_require__(3); @@ -5026,6 +5034,10 @@ exports.errors = { ref: 'references "{{ref}}" which is not a number', ip: 'must be a valid ip address with a {{cidr}} CIDR', ipVersion: 'must be a valid ip address of one of the following versions {{version}} with a {{cidr}} CIDR' + }, + symbol: { + base: 'must be a symbol', + map: 'must be one of {{map}}' } }; @@ -5039,7 +5051,7 @@ exports.errors = { // Load modules -const Joi = __webpack_require__(5); +const Joi = __webpack_require__(6); // Declare internals @@ -7373,7 +7385,7 @@ module.exports = internals.Ip; // Load modules const Punycode = __webpack_require__(31); -const Util = __webpack_require__(6); +const Util = __webpack_require__(4); // Declare internals @@ -8807,9 +8819,109 @@ module.exports = require("punycode"); /***/ }), /* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Load modules + +const Util = __webpack_require__(4); + +const Any = __webpack_require__(1); +const Hoek = __webpack_require__(0); + + +// Declare internals + +const internals = {}; + + +internals.Map = class extends Map { + + slice() { + + return new internals.Map(this); + } + + toString() { + + return Util.inspect(this); + } +}; + + +internals.Symbol = class extends Any { + + constructor() { + + super(); + this._type = 'symbol'; + this._inner.map = new internals.Map(); + } + + _base(value, state, options) { + + if (options.convert) { + const lookup = this._inner.map.get(value); + if (lookup) { + value = lookup; + } + + if (this._flags.allowOnly) { + return { + value, + errors: (typeof value === 'symbol') ? null : this.createError('symbol.map', { map: this._inner.map }, state, options) + }; + } + } + + return { + value, + errors: (typeof value === 'symbol') ? null : this.createError('symbol.base', null, state, options) + }; + } + + map(iterable) { + + if (iterable && !iterable[Symbol.iterator] && typeof iterable === 'object') { + iterable = Object.entries(iterable); + } + + Hoek.assert(iterable && iterable[Symbol.iterator], 'Iterable must be an iterable or object'); + const obj = this.clone(); + + const symbols = []; + for (const entry of iterable) { + Hoek.assert(entry && entry[Symbol.iterator], 'Entry must be an iterable'); + const [key, value] = entry; + + Hoek.assert(typeof key !== 'object' && typeof key !== 'function' && typeof key !== 'symbol', 'Key must not be an object, function, or Symbol'); + Hoek.assert(typeof value === 'symbol', 'Value must be a Symbol'); + obj._inner.map.set(key, value); + symbols.push(value); + } + + return obj.valid(...symbols); + } + + describe() { + + const description = super.describe(); + description.map = new Map(this._inner.map); + return description; + } +}; + + +module.exports = new internals.Symbol(); + + +/***/ }), +/* 33 */ /***/ (function(module) { -module.exports = {"name":"joi","description":"Object schema validation","version":"13.6.0","homepage":"https://github.com/hapijs/joi","repository":"git://github.com/hapijs/joi","main":"lib/index.js","keywords":["hapi","schema","validation"],"engines":{"node":">=8.9.0"},"dependencies":{"hoek":"5.x.x","isemail":"3.x.x","topo":"3.x.x"},"devDependencies":{"code":"5.x.x","hapitoc":"1.x.x","lab":"15.x.x","webpack":"^4.16.5","webpack-cli":"^3.1.0"},"scripts":{"build":"webpack","test":"lab -t 100 -a code -L","test-debug":"lab -a code","test-cov-html":"lab -r html -o coverage.html -a code","toc":"hapitoc","version":"npm run toc && git add API.md README.md"},"license":"BSD-3-Clause"}; +module.exports = {"name":"joi","description":"Object schema validation","version":"13.7.0","homepage":"https://github.com/hapijs/joi","repository":"git://github.com/hapijs/joi","main":"lib/index.js","keywords":["hapi","schema","validation"],"engines":{"node":">=8.9.0"},"dependencies":{"hoek":"5.x.x","isemail":"3.x.x","topo":"3.x.x"},"devDependencies":{"code":"5.x.x","hapitoc":"1.x.x","lab":"15.x.x","webpack":"^4.16.5","webpack-cli":"^3.1.0"},"scripts":{"build":"webpack","test":"lab -t 100 -a code -L","test-debug":"lab -a code","test-cov-html":"lab -r html -o coverage.html -a code","toc":"hapitoc","version":"npm run toc && git add API.md README.md"},"license":"BSD-3-Clause"}; /***/ }) -/******/ ]); +/******/ ]); \ No newline at end of file