New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@algebraic/ast

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@algebraic/ast - npm Package Compare versions

Comparing version 1.0.0-alpha.17 to 1.0.0-alpha.18

6

package.json
{
"name": "@algebraic/ast",
"version": "1.0.0-alpha.17",
"version": "1.0.0-alpha.18",
"description": "",

@@ -18,5 +18,5 @@ "main": "node.js",

"peerDependencies": {
"@algebraic/type": "1.0.0-alpha.17",
"@algebraic/collectoons": "1.0.0-alpha.17"
"@algebraic/type": "1.0.0-alpha.18",
"@algebraic/collectoons": "1.0.0-alpha.18"
}
}

@@ -7,6 +7,16 @@ const { is } = require("@algebraic/type");

const Negative = argument => Node.UnaryExpression({ operator: "-", argument });
const ZeroLiteral = Node.NumericLiteral({ value: 0 });
const NegativeZeroLiteral =
Node.UnaryExpression({ operator: "-", argument: ZeroLiteral });
const NegativeZeroLiteral = Negative(ZeroLiteral);
const OneLiteral = Node.NumericLiteral({ value: 1 });
const NegativeOneLiteral = Negative(OneLiteral);
const Divide = (left, right) =>
Node.BinaryExpression({ operator: "/", left, right });
const NaNLiteral = Divide(ZeroLiteral, ZeroLiteral);
const InfinityLiteral = Divide(OneLiteral, ZeroLiteral);
const NegativeInfinityLiteral = Divide(NegativeOneLiteral, ZeroLiteral);
const TrueLiteral = Node.BooleanLiteral({ value: true });

@@ -34,10 +44,12 @@ const FalseLiteral = Node.BooleanLiteral({ value: false });

if (Object.is(0, value))
return ZeroLiteral;
if (Object.is(-0, value))
return NegativeZeroLiteral;
if (typeof value === "number")
return Node.NumericLiteral({ value });
return isNaN(value) ? NaNLiteral :
value === Infinity ? InfinityLiteral :
value === -Infinity ? NegativeInfinityLiteral :
Object.is(-0, value) ? NegativeZeroLiteral :
value === 0 ? ZeroLiteral :
value === 1 ? OneLiteral :
value === -1 ? NegativeOneLiteral :
value > 0 ? Node.NumericLiteral({ value }) :
Negative(Node.NumericLiteral({ value: -value }));

@@ -44,0 +56,0 @@ if (typeof value === "string")

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