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

ngraph.physics.primitives

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngraph.physics.primitives - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

10

index.js

@@ -7,11 +7,11 @@ module.exports = {

function Body() {
function Body(x, y) {
this.pos = new Vector2d(x, y);
this.force = new Vector2d();
this.pos = new Vector2d();
this.mass = 1;
}
function Vector2d() {
this.x = 0;
this.y = 0;
function Vector2d(x, y) {
this.x = typeof x === 'number' ? x : 0;
this.y = typeof y === 'number' ? y : 0;
}
{
"name": "ngraph.physics.primitives",
"version": "0.0.1",
"version": "0.0.2",
"description": "Physics primitives for ngraph.* libraries",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -16,3 +16,11 @@ var test = require('tap').test,

t.ok(typeof vector.y === 'number', 'Vector has y coordinates');
var initialized = new primitives.Vector2d(1, 2);
t.equal(initialized.x, 1, 'Vector initialized imporperly');
t.equal(initialized.y, 2, 'Vector initialized imporperly');
var badInput = new primitives.Vector2d('hello world');
t.equal(badInput.x, 0, 'Vector should be resilient to bed input');
t.equal(badInput.y, 0, 'Vector should be resilient to bed input');
t.end();
});

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