New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

jsbakery

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsbakery - npm Package Compare versions

Comparing version
0.0.1
to
0.0.2
+53
-2
index.js

@@ -171,2 +171,49 @@ const fs = require('fs');

//Location
class Location {
constructor(latitude, longitude) {
this.latitude = latitude;
this.longitude = longitude;
}
getLatitude() {
return this.latitude;
}
getLongitude() {
return this.longitude;
}
setLatitude(latitude) {
this.latitude = latitude;
}
setLongitude(longitude) {
this.longitude = longitude;
}
calculateDistance(otherLocation) {
const R = 6371e3;
const φ1 = this.latitude * Math.PI / 180;
const φ2 = otherLocation.getLatitude() * Math.PI / 180;
const Δφ = (otherLocation.getLatitude() - this.latitude) * Math.PI / 180;
const Δλ = (otherLocation.getLongitude() - this.longitude) * Math.PI / 180;
const a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) +
Math.cos(φ1) * Math.cos(φ2) *
Math.sin(Δλ / 2) * Math.sin(Δλ / 2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
const distance = R * c;
return distance;
}
}
const currentLocation = new Location(37.7749, -122.4194); // San Francisco coordinates
const destination = new Location(34.0522, -118.2437); // Los Angeles coordinates
const distance = currentLocation.calculateDistance(destination);
console.log("Distance between San Francisco and Los Angeles:", distance.toFixed(2), "meters");
//RGB2Hex

@@ -204,3 +251,7 @@ function RGB2Hex(R, G, B){

}
module.exports = Bake
if(typeof module !== "undefined"){
module.exports = Bake
}
else {
exports.exports = Bake
}
{
"name": "jsbakery",
"version": "0.0.1",
"version": "0.0.2",
"description": "Bake up your javascript using the new bake module",

@@ -16,3 +16,9 @@ "main": "index.js",

},
"exports": {
".": {
"import": "./index.js",
"require": "./index.js"
}
},
"devDependencies": {}
}