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

@hapi/formula

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapi/formula - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

2

lib/index.js

@@ -318,3 +318,3 @@ 'use strict';

return method(...innerValues);
return method.call(context, ...innerValues);
};

@@ -321,0 +321,0 @@ }

{
"name": "@hapi/formula",
"description": "Math and string formula parser.",
"version": "1.1.0",
"version": "1.2.0",
"repository": "git://github.com/hapijs/formula",

@@ -15,4 +15,4 @@ "main": "lib/index.js",

"devDependencies": {
"@hapi/code": "5.x.x",
"@hapi/lab": "18.x.x"
"@hapi/code": "6.x.x",
"@hapi/lab": "20.x.x"
},

@@ -19,0 +19,0 @@ "scripts": {

@@ -118,2 +118,15 @@ 'use strict';

it('passes context as this to functions', () => {
const functions = {
x: function () {
return this.X;
}
};
const formula = new Formula('x()', { functions });
expect(formula.evaluate({ X: 1 })).to.equal(1);
});
it('parses parenthesis', () => {

@@ -120,0 +133,0 @@

Sorry, the diff of this file is not supported yet

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