]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/get.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / npm-registry-client / lib / get.js
1 module.exports = get
2
3 var assert = require('assert')
4 var url = require('url')
5
6 /*
7  * This is meant to be overridden in specific implementations if you
8  * want specialized behavior for metadata (i.e. caching).
9  */
10 function get (uri, params, cb) {
11   assert(typeof uri === 'string', 'must pass registry URI to get')
12   assert(params && typeof params === 'object', 'must pass params to get')
13   assert(typeof cb === 'function', 'must pass callback to get')
14
15   var parsed = url.parse(uri)
16   assert(
17     parsed.protocol === 'http:' || parsed.protocol === 'https:',
18     'must have a URL that starts with http: or https:'
19   )
20
21   this.request(uri, params, cb)
22 }