Socket
Socket
Sign inDemoInstall

joi

Package Overview
Dependencies
5
Maintainers
6
Versions
236
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 17.10.2 to 17.11.0

24

lib/template.js

@@ -40,4 +40,17 @@ 'use strict';

this._template = null;
this._settings = Clone(options);
if (options) {
const { functions, ...opts } = options;
this._settings = Object.keys(opts).length ? Clone(opts) : undefined;
this._functions = functions;
if (this._functions) {
Assert(Object.keys(this._functions).every((key) => typeof key === 'string'), 'Functions keys must be strings');
Assert(Object.values(this._functions).every((key) => typeof key === 'function'), 'Functions values must be functions');
}
}
else {
this._settings = undefined;
this._functions = undefined;
}
this._parse();

@@ -126,2 +139,6 @@ }

if (this._functions) {
desc.functions = this._functions;
}
return desc;

@@ -132,3 +149,3 @@ }

return new internals.Template(desc.template, desc.options);
return new internals.Template(desc.template, desc.options || desc.functions ? { ...desc.options, functions: desc.functions } : undefined);
}

@@ -221,3 +238,4 @@

try {
var formula = new Formula.Parser(content, { reference, functions: internals.functions, constants: internals.constants });
const functions = this._functions ? { ...internals.functions, ...this._functions } : internals.functions;
var formula = new Formula.Parser(content, { reference, functions, constants: internals.constants });
}

@@ -224,0 +242,0 @@ catch (err) {

2

package.json
{
"name": "joi",
"description": "Object schema validation",
"version": "17.10.2",
"version": "17.11.0",
"repository": "git://github.com/hapijs/joi",

@@ -6,0 +6,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc