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

windrose

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

windrose - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

bower.json
{
"name": "windrose",
"main": "windrose.js",
"version": "2.0.0",
"version": "2.0.1",
"homepage": "https://github.com/rogeriopvl/windrose",

@@ -6,0 +6,0 @@ "authors": [

{
"name": "windrose",
"version": "2.0.0",
"version": "2.0.1",
"description": "Convert compass degrees into points of the compass and vice versa",

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

@@ -75,2 +75,10 @@ var expect = require('chai').expect;

it('should return N when passing 359 degrees with 2 depth', function (done) {
var res = Windrose.getPoint(359, { depth: 2 });
expect(res).to.be.an('object');
expect(res.symbol).to.equal('N');
done();
});
it('should return undefined when passing invalid depth', function (done) {

@@ -77,0 +85,0 @@ var res = Windrose.getPoint(15, { depth: 0 });

@@ -89,10 +89,11 @@ /**

var idx = Math.round(degrees / DEPTHS_AREA[opts.depth]);
var _compass_points = COMPASS_POINTS.filter(function (pt) {
return pt.depth <= opts.depth;
});
// 360 === 0 aka North
if (idx === COMPASS_POINTS.length) {
if (idx === _compass_points.length) {
idx = 0;
}
return COMPASS_POINTS.filter(function (pt) {
return pt.depth <= opts.depth;
})[idx];
return _compass_points[idx];
},

@@ -99,0 +100,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