tileblaster 1.0.13 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/builtins/check.js CHANGED
@@ -123,7 +123,7 @@ module.exports = function({ req, res, opts, data }, next, skip){
123
123
  if (opts.extensions.length > 0 && !opts.extensions.includes(data.req.params.e) && !opts.extensions.includes(data.req.params.f)) return abort(new Error("illegal extension."));
124
124
 
125
125
  // check density
126
- if (opts.density && !opts.density.includes(data.req.params.d) && !opts.density.includes(data.req.params.f)) return abort(new Error("illegal density marker."));
126
+ if (opts.density && !opts.density.includes(data.req.params.d) && !opts.density.includes(data.req.params.r)) return abort(new Error("illegal density marker."));
127
127
 
128
128
  // all passed
129
129
  next();
@@ -45,7 +45,7 @@ module.exports = function({ req, res, opts, data }, next){
45
45
  // set subdomain if configured
46
46
  if (opts.subdomains) params.s = opts.subdomains[ Date.now() % opts.subdomains.length ];
47
47
 
48
- const tileurl = strtpl(opts.url, params);
48
+ const tileurl = (typeof opts.url === "function") ? opts.url(params) : strtpl(opts.url, params);
49
49
 
50
50
  // FIXME check fails cache
51
51
 
package/lib/debug.js CHANGED
@@ -43,7 +43,7 @@ module.exports.error = function(){
43
43
  if (!enabled) return;
44
44
 
45
45
  let stacks = [];
46
- arguments = Array.from(arguments).map(function(arg){
46
+ let args = Array.from(arguments).map(function(arg){
47
47
  if (arg instanceof Error) {
48
48
  if (arg.stack) stacks.push(arg.stack);
49
49
  return arg.message;
@@ -51,7 +51,7 @@ module.exports.error = function(){
51
51
  return arg;
52
52
  });
53
53
 
54
- console.error(prefix()+"Error:".red+" %s %s", format(...arguments), since().brightRed);
54
+ console.error(prefix()+"Error:".red+" %s %s", format(...args), since().brightRed);
55
55
 
56
56
  // format and prettify stack (a little overkill)
57
57
  stacks.forEach(function(stack){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tileblaster",
3
- "version": "1.0.13",
3
+ "version": "1.1.0",
4
4
  "description": "a quick and versatile map tile caching proxy",
5
5
  "main": "tileblaster.js",
6
6
  "bin": {
@@ -26,17 +26,17 @@
26
26
  "klaw": "^4.1.0",
27
27
  "minimist": "^1.2.8",
28
28
  "node-watch": "^0.7.4",
29
- "phn": "^0.0.1",
30
- "quu": "^0.4.3"
29
+ "phn": "^0.1.1",
30
+ "quu": "^0.5.0"
31
31
  },
32
32
  "optionalDependencies": {
33
- "fzstd": "^0.1.0",
33
+ "fzstd": "^0.1.1",
34
34
  "js-mozjpeg": "^0.1.2",
35
35
  "mbg": "^0.0.2",
36
36
  "node-liblzma": "^1.1.9",
37
37
  "optipng-js": "^0.1.2",
38
38
  "pmtiles": "^2.11.0",
39
- "sharp": "^0.33.2",
39
+ "sharp": "^0.33.5",
40
40
  "versatiles": "^0.3.1",
41
41
  "vtt": "^0.0.3"
42
42
  },
package/tileblaster.js CHANGED
@@ -436,7 +436,7 @@ tileblaster.prototype.listen = function(router){
436
436
 
437
437
  if (listen.port) {
438
438
 
439
- server.listen(listen.port, listen.port, function(err){
439
+ server.listen(listen.port, listen.host, function(err){
440
440
  if (err) return debug.error("listen: ERROR binding port '%s:%d':", listen.host, listen.port, err);
441
441
  debug.info("Listening on '%s:%d'", listen.host, listen.port);
442
442
  self.servers.push(server);