New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

geo.what3words

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geo.what3words - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

26

lib/geo.what3words.js

@@ -32,28 +32,2 @@ var request = require('request'),

/**
* Checks if oneWord is available
* @param {[object]} options Can contain the following properties:
* * lang: alternative language, default will be usef if this is not declared.
* * word: a string containing the oneWord
* * full: Return the full response
*/
What3Words.prototype.oneWordAvailable = function (options) {
var language = options.lang || this.language;
return new Promise(_.bind(function(resolve, reject) {
this.execute('oneword-available', {word: options.word, lang: language})
.then(function(res) {
if (options.full) {
resolve(res);
} else {
resolve(res.available);
}
})
.catch(function(err) {
reject(err);
});
}, this));
};
/**
* Convert GPS co-ordinates into 3 words.

@@ -60,0 +34,0 @@ * @param {[object]} options Can contain the following properties:

6

package.json

@@ -5,7 +5,7 @@ {

"main": "index.js",
"version": "0.1.0",
"version": "0.2.0",
"private": false,
"repository": {
"type": "git",
"url": "https://github.com/lokku/js-geo-what3words.git"
"url": "https://github.com/OpenCageData/js-geo-what3words.git"
},

@@ -37,4 +37,4 @@ "scripts": {

"bugs": {
"url": "https://github.com/lokku/js-geo-what3words/issues"
"url": "https://github.com/OpenCageData/js-geo-what3words/issues"
}
}
var should = require('should'),
What3Words = require('../lib/geo.what3words'),
API_KEY = 'YOUR_API_KEY';
API_KEY = 'YOUR_API_KEY';

@@ -49,2 +49,3 @@ describe('What3Words API Wrapper', function(){

res.should.be.a.Array;
res.length.should.be.greaterThan(0);
done();

@@ -72,13 +73,4 @@ });

it('should be able to check if a word is available', function(done) {
w3w.oneWordAvailable({
word: 'nestoria'
}).then(function(res) {
res.should.eql('1').and.be.a.Number;
done();
});
});
});
});
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