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

nectar-leg

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nectar-leg - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

17

index.js

@@ -14,11 +14,14 @@ function Rectangle(x, y, width, height) {

Rectangle.prototype.perimeter = function () {
return (this.width * 2) + (this.height * 2);
};
Object.defineProperty(Rectangle.prototype, 'perimeter', {
get: function () {
return (this.width * 2) + (this.height * 2);
}
});
Rectangle.prototype.area = function () {
return this.width * this.height;
};
Object.defineProperty(Rectangle.prototype, 'area', {
get: function () {
return this.width * this.height;
}
});
module.exports = Rectangle;
{
"name": "nectar-leg",
"version": "1.0.0",
"version": "2.0.0",
"description": "A fun JavaScript library for working with rectangles.",

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

@@ -55,9 +55,5 @@ const assert = require('assert');

it('should have a perimeter method', function () {
assert(Rectangle.prototype.perimeter, 'Prototype does not have a perimeter method.');
});
it('should return the perimeter of the rectangle', function () {
var rect = new Rectangle(0, 0, 10, 10);
assert.equal(rect.perimeter(), 40);
assert.equal(rect.perimeter, 40);
});

@@ -69,9 +65,5 @@

it('should have a area method', function () {
assert(Rectangle.prototype.area, 'Prototype does not have a area method.');
});
it('should return the area of the rectangle', function () {
var rect = new Rectangle(0, 0, 10, 10);
assert.equal(rect.area(), 100);
assert.equal(rect.area, 100);
});

@@ -78,0 +70,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