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

timezoner

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timezoner - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

.travis.yml

17

lib/timezone.js

@@ -5,3 +5,2 @@ /**

var Timezone = function () {

@@ -30,2 +29,12 @@

/**
* Check coordinates are numbers
*
* @param {String} number, required
* @api private
*/
isNumber = function (n) {
return !isNaN(parseFloat(n)) && isFinite(n);
},
/**

@@ -51,3 +60,3 @@ * Makes request to Google Time Zone API and passes result to a callback

/**
* Request timezone with given location cordinates from Google
* Request timezone with given location coordinates from Google
*

@@ -61,4 +70,4 @@ * @param {String} lat, required

getTimeZone = function (lat, lng, cb, opts) {
if (!lat || !lng) {
return cb(new Error("Time Zone requires latitude and longitude coordinates."));
if (!isNumber(lat) || !isNumber(lng)) {
return cb(new Error("Timezoner requires valid latitude and longitude coordinates."));
}

@@ -65,0 +74,0 @@ var timestamp = Math.round((new Date()).getTime() / 1000),

@@ -15,3 +15,3 @@ {

"homepage": "https://github.com/justin-john/node-timezone",
"version": "0.1.4",
"version": "0.1.5",
"author": {

@@ -18,0 +18,0 @@ "name": "Justin John Mathews",

node-timezone
=============
[![build status](https://secure.travis-ci.org/justin-john/node-timezone.png)](http://travis-ci.org/justin-john/node-timezone)
Node.js client library for accessing [Google Time Zone API](https://developers.google.com/maps/documentation/timezone).

@@ -40,3 +42,3 @@ It provides time offset data for locations on the surface of the earth.

You can pass in an optional options as a last argument, it can be useful for override [sensor](https://developers.google.com/maps/documentation/timezone/#RequiredParam) parameter of Google Timezone API. The `sensor` defaults to `false`.
You can pass in an optional options as a last argument, it can be useful for override [sensor](https://developers.google.com/maps/documentation/timezone/#RequiredParam) of Google Timezone API. The `sensor` defaults to `false`.
```js

@@ -56,3 +58,3 @@ timezoner.getTimeZone(

```
The `sensor` parameter specifies whether the application requesting data is using a sensor (such as a GPS device) to determine the user's location. It accepts true or false.
The `sensor` specifies whether the application requesting data is using a sensor (such as a GPS device) to determine the user's location. It accepts true or false.

@@ -59,0 +61,0 @@ You can find more details about response and different status of response from [Time Zone Responses](https://developers.google.com/maps/documentation/timezone/#Responses).

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