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

geokit

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geokit - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

dist/geokit.d.ts

6

CHANGELOG.md

@@ -0,1 +1,7 @@

#### 0.0.3 (2018-03-24)
##### Refactors
* split out validators and make functions static ([9e7cc083](https://github.com/MichaelSolati/geokit/commit/9e7cc083f21d6b153c393fe1ea71cc249e1c2681))
#### 0.0.2 (2018-03-08)

@@ -2,0 +8,0 @@

2

package.json
{
"name": "geokit",
"version": "0.0.2",
"version": "0.0.3",
"description": "An assortment of geolocation related tools, all packaged in one easy to use kit.",

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

@@ -1,2 +0,2 @@

import { geokit } from '../src/geokit';
import { Geokit } from '../src/geokit';
import { LatLngLiteral } from '../src/interfaces';

@@ -10,24 +10,24 @@

it('Distance between New Haven and Sydney should be 16082.811206563834 km', () => {
expect(geokit.distance({ lat: 41.3083, lng: -72.9279 }, { lat: -33.8688, lng: 151.2093 })).to.equal(16082.811206563834);
expect(Geokit.distance({ lat: 41.3083, lng: -72.9279 }, { lat: -33.8688, lng: 151.2093 })).to.equal(16082.811206563834);
});
it('Distance between New York and San Francisco should be 2568.4458439997047 miles', () => {
expect(geokit.distance({ lat: 40.7128, lng: -74.0060 }, { lat: 37.7749, lng: -122.4194 }, 'miles')).to.equal(2568.4458439997047);
expect(Geokit.distance({ lat: 40.7128, lng: -74.0060 }, { lat: 37.7749, lng: -122.4194 }, 'miles')).to.equal(2568.4458439997047);
});
it('Distance between 0, 0 and 91, 0 with should throw an Error', () => {
expect(() => geokit.distance({ lat: 0, lng: 0 }, { lat: 91, lng: 0 })).to.throw(null, 'End coordinates: Your latitude is greater than 90°');
expect(() => Geokit.distance({ lat: 0, lng: 0 }, { lat: 91, lng: 0 })).to.throw(null, 'End coordinates: Your latitude is greater than 90°');
});
it('Hash coordinates 41.3083, -72.9279 should yield \'drk4urzw2c\'', () => {
expect(geokit.hash({ lat: 41.3083, lng: -72.9279 })).to.equal('drk4urzw2c');
expect(Geokit.hash({ lat: 41.3083, lng: -72.9279 })).to.equal('drk4urzw2c');
});
it('Hash coordinates -33.8688, 151.2093 with a precision of 9 should yield \'r3gx2f77b\'', () => {
expect(geokit.hash({ lat: -33.8688, lng: 151.2093 }, 9)).to.equal('r3gx2f77b');
expect(Geokit.hash({ lat: -33.8688, lng: 151.2093 }, 9)).to.equal('r3gx2f77b');
});
it('Hash coordinates 91, 0 with should throw an Error', () => {
expect(() => geokit.hash({ lat: 91, lng: 0 })).to.throw(null, 'Your latitude is greater than 90°');
expect(() => Geokit.hash({ lat: 91, lng: 0 })).to.throw(null, 'Your latitude is greater than 90°');
});
});

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