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

@informath/nominatim

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@informath/nominatim - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

34

lib/nominatim.js

@@ -1,26 +0,26 @@

const fetch = require('node-fetch');
const fetch = require('node-fetch'), // Forgot the "Usage Policy" part... NotLikeThis
TQueue = require('tqueue');
const defaults = {
addressdetails: 1,
limit: ,
format: 'json'
};
const baseUrl = 'https://nominatim.openstreetmap.org/'
const queue = new TQueue({delay: 1000});
const baseUrl = 'https://nominatim.openstreetmap.org/';
queue.on('pop', async (item) => {
item.fn(await (await fetch(item.url)).json());
});
const Nominatim = Proxy({}, {
get: (obj, prop) => (prop == 'default' ? {
addressdetails: 1,
limit: 3,
limit: 10,
format: 'json'
} : async (options, overwriteDefault) => await (
await fetch(
`${baseUrl}${prop}?${
Object.entries({ ...(overwriteDefault ? {} : Nominatim.default, ...options })
.map(([i, v]) => `${i}=${v}`)
.join('&')
}`
)
).json())
} : (options, overwriteDefault) => return new Promise((res) => queue.push({
url: `${baseUrl}${prop}?${
Object.entries({ ...(overwriteDefault ? {} : Nominatim.default, ...options })
.map(([i, v]) => `${i}=${v}`)
.join('&')
}`,
fn: res,
}))
});
module.exports = Nominatim;

@@ -5,3 +5,3 @@ {

"description": "Completely rewritten version of David Howell's Nominatim",
"version": "2.0.0",
"version": "3.0.0",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

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