Socket
Socket
Sign inDemoInstall

@emartech/data-aggregator-language

Package Overview
Dependencies
Maintainers
171
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emartech/data-aggregator-language - npm Package Compare versions

Comparing version 2.6.0 to 2.6.1

2

package.json

@@ -30,3 +30,3 @@ {

},
"version": "2.6.0"
"version": "2.6.1"
}

@@ -78,2 +78,14 @@ 'use strict';

});
it('works with a single negative number', () => {
expect(aggregate('-5')).to.eql(-5);
});
it('Subtraction with negative number', () => {
expect(aggregate('5 - -5')).to.eql(10);
});
it('should throw error when -- is used', () => {
expect(() => aggregate('--5')).to.throw('Error parsing "--5"');
});
it('should work with positive number(with plus sign)', () => {
expect(aggregate('+5')).to.eql(5);
});
});

@@ -80,0 +92,0 @@

@@ -88,2 +88,5 @@ 'use strict';

numberExpression(ctx) {
if (ctx.minusOperator) {
return parseFloat(ctx.numberLiteral[0].image) * -1;
}
return parseFloat(ctx.numberLiteral[0].image);

@@ -90,0 +93,0 @@ }

@@ -133,2 +133,7 @@ 'use strict';

$.RULE('numberExpression', () => {
$.OPTION(() => {
$.OR([
{ ALT: () => $.CONSUME(minusOperator) },
{ ALT: () => $.CONSUME(plusOperator) }]);
});
$.CONSUME(numberLiteral);

@@ -135,0 +140,0 @@ });

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