@basemaps/lambda-tiler 6.19.0 → 6.20.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.
Files changed (157) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +2 -2
  3. package/build/__test__/tile.style.json.test.d.ts +2 -0
  4. package/build/__test__/tile.style.json.test.d.ts.map +1 -0
  5. package/build/__test__/tile.style.json.test.js +33 -0
  6. package/build/__test__/xyz.test.js +24 -23
  7. package/build/cli/dump.js +2 -2
  8. package/build/index.d.ts.map +1 -1
  9. package/build/index.js +2 -0
  10. package/build/routes/esri/rest.d.ts +10 -0
  11. package/build/routes/esri/rest.d.ts.map +1 -0
  12. package/build/routes/esri/rest.js +87 -0
  13. package/build/routes/imagery.d.ts +2 -0
  14. package/build/routes/imagery.d.ts.map +1 -1
  15. package/build/routes/imagery.js +3 -1
  16. package/build/routes/response.d.ts +4 -0
  17. package/build/routes/response.d.ts.map +1 -0
  18. package/build/routes/response.js +3 -0
  19. package/build/routes/tile.d.ts +0 -20
  20. package/build/routes/tile.d.ts.map +1 -1
  21. package/build/routes/tile.js +11 -161
  22. package/build/routes/tile.json.d.ts +10 -0
  23. package/build/routes/tile.json.d.ts.map +1 -0
  24. package/build/routes/tile.json.js +31 -0
  25. package/build/routes/tile.style.json.d.ts +10 -0
  26. package/build/routes/tile.style.json.d.ts.map +1 -0
  27. package/build/routes/tile.style.json.js +74 -0
  28. package/build/routes/tile.wmts.d.ts +9 -0
  29. package/build/routes/tile.wmts.d.ts.map +1 -0
  30. package/build/routes/tile.wmts.js +57 -0
  31. package/build/routes/tile.xyz.d.ts +13 -0
  32. package/build/routes/tile.xyz.d.ts.map +1 -0
  33. package/build/routes/tile.xyz.js +28 -0
  34. package/build/tile.set.raster.d.ts +2 -0
  35. package/build/tile.set.raster.d.ts.map +1 -1
  36. package/build/tile.set.raster.js +3 -1
  37. package/build/tile.set.vector.js +1 -1
  38. package/dist/index.js +10545 -9583
  39. package/dist/node_modules/color/README.md +7 -7
  40. package/dist/node_modules/color/index.js +173 -158
  41. package/dist/node_modules/color/package.json +18 -16
  42. package/dist/node_modules/color-convert/conversions.js +281 -310
  43. package/dist/node_modules/color-convert/index.js +27 -24
  44. package/dist/node_modules/color-convert/package.json +16 -14
  45. package/dist/node_modules/color-convert/route.js +22 -22
  46. package/dist/node_modules/color-name/package.json +17 -14
  47. package/dist/node_modules/color-string/package.json +5 -5
  48. package/dist/node_modules/decompress-response/index.d.ts +14 -21
  49. package/dist/node_modules/decompress-response/index.js +34 -16
  50. package/dist/node_modules/decompress-response/license +1 -1
  51. package/dist/node_modules/decompress-response/package.json +23 -17
  52. package/dist/node_modules/decompress-response/readme.md +2 -6
  53. package/dist/node_modules/detect-libc/package.json +0 -1
  54. package/dist/node_modules/mimic-response/index.d.ts +2 -2
  55. package/dist/node_modules/mimic-response/index.js +41 -2
  56. package/dist/node_modules/mimic-response/package.json +17 -17
  57. package/dist/node_modules/mimic-response/readme.md +22 -1
  58. package/dist/node_modules/node-abi/.circleci/config.yml +63 -0
  59. package/dist/node_modules/node-abi/.releaserc.json +9 -0
  60. package/dist/node_modules/node-abi/abi_registry.json +39 -4
  61. package/dist/node_modules/node-abi/index.js +5 -2
  62. package/dist/node_modules/node-abi/package.json +17 -16
  63. package/dist/node_modules/node-abi/test/index.js +7 -15
  64. package/dist/node_modules/node-addon-api/README.md +2 -2
  65. package/dist/node_modules/node-addon-api/except.gypi +20 -11
  66. package/dist/node_modules/node-addon-api/napi-inl.h +734 -196
  67. package/dist/node_modules/node-addon-api/napi.h +420 -164
  68. package/dist/node_modules/node-addon-api/noexcept.gypi +21 -11
  69. package/dist/node_modules/node-addon-api/package.json +43 -14
  70. package/dist/node_modules/node-addon-api/tools/clang-format.js +18 -17
  71. package/dist/node_modules/node-addon-api/tools/eslint-format.js +71 -0
  72. package/dist/node_modules/prebuild-install/CHANGELOG.md +24 -7
  73. package/dist/node_modules/prebuild-install/README.md +24 -4
  74. package/dist/node_modules/prebuild-install/asset.js +10 -10
  75. package/dist/node_modules/prebuild-install/bin.js +13 -13
  76. package/dist/node_modules/prebuild-install/download.js +22 -22
  77. package/dist/node_modules/prebuild-install/log.js +4 -4
  78. package/dist/node_modules/prebuild-install/node_modules/detect-libc/LICENSE +201 -0
  79. package/dist/node_modules/prebuild-install/node_modules/detect-libc/README.md +160 -0
  80. package/dist/node_modules/prebuild-install/node_modules/detect-libc/index.d.ts +11 -0
  81. package/dist/node_modules/prebuild-install/node_modules/detect-libc/lib/detect-libc.js +178 -0
  82. package/dist/node_modules/prebuild-install/node_modules/detect-libc/lib/process.js +16 -0
  83. package/dist/node_modules/prebuild-install/node_modules/detect-libc/package.json +71 -0
  84. package/dist/node_modules/prebuild-install/package.json +18 -19
  85. package/dist/node_modules/prebuild-install/proxy.js +10 -10
  86. package/dist/node_modules/prebuild-install/rc.js +12 -12
  87. package/dist/node_modules/prebuild-install/util.js +14 -14
  88. package/dist/node_modules/semver/package.json +1 -0
  89. package/dist/node_modules/sharp/README.md +2 -2
  90. package/dist/node_modules/sharp/binding.gyp +12 -9
  91. package/dist/node_modules/sharp/build/Release/sharp-linux-x64.node +0 -0
  92. package/dist/node_modules/sharp/install/dll-copy.js +6 -6
  93. package/dist/node_modules/sharp/install/libvips.js +4 -8
  94. package/dist/node_modules/sharp/lib/channel.js +11 -7
  95. package/dist/node_modules/sharp/lib/colour.js +42 -1
  96. package/dist/node_modules/sharp/lib/constructor.js +18 -31
  97. package/dist/node_modules/sharp/lib/input.js +45 -3
  98. package/dist/node_modules/sharp/lib/is.js +19 -5
  99. package/dist/node_modules/sharp/lib/libvips.js +4 -19
  100. package/dist/node_modules/sharp/lib/operation.js +28 -5
  101. package/dist/node_modules/sharp/lib/output.js +147 -16
  102. package/dist/node_modules/sharp/lib/sharp.js +31 -0
  103. package/dist/node_modules/sharp/lib/utility.js +3 -2
  104. package/dist/node_modules/sharp/package.json +32 -23
  105. package/dist/node_modules/sharp/src/common.cc +67 -11
  106. package/dist/node_modules/sharp/src/common.h +25 -5
  107. package/dist/node_modules/sharp/src/libvips/cplusplus/VConnection.cpp +0 -26
  108. package/dist/node_modules/sharp/src/libvips/cplusplus/VImage.cpp +54 -16
  109. package/dist/node_modules/sharp/src/libvips/cplusplus/VInterpolate.cpp +0 -13
  110. package/dist/node_modules/sharp/src/libvips/cplusplus/vips-operators.cpp +185 -1
  111. package/dist/node_modules/sharp/src/metadata.cc +14 -0
  112. package/dist/node_modules/sharp/src/metadata.h +1 -0
  113. package/dist/node_modules/sharp/src/operations.cc +29 -3
  114. package/dist/node_modules/sharp/src/operations.h +13 -2
  115. package/dist/node_modules/sharp/src/pipeline.cc +103 -35
  116. package/dist/node_modules/sharp/src/pipeline.h +23 -3
  117. package/dist/node_modules/sharp/src/utilities.cc +1 -1
  118. package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/THIRD-PARTY-NOTICES.md +2 -3
  119. package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/lib/libvips-cpp.so.42 +0 -0
  120. package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/platform.json +0 -0
  121. package/dist/node_modules/sharp/vendor/8.11.3/linux-x64/versions.json +30 -0
  122. package/dist/node_modules/simple-get/.github/dependabot.yml +15 -0
  123. package/dist/node_modules/simple-get/.github/workflows/ci.yml +23 -0
  124. package/dist/node_modules/simple-get/README.md +17 -3
  125. package/dist/node_modules/simple-get/index.js +9 -0
  126. package/dist/node_modules/simple-get/package.json +27 -13
  127. package/dist/package-lock.json +51 -51
  128. package/dist/package.json +9 -9
  129. package/package.json +10 -10
  130. package/src/__test__/tile.style.json.test.ts +40 -0
  131. package/src/__test__/xyz.test.ts +32 -30
  132. package/src/cli/dump.ts +2 -2
  133. package/src/index.ts +2 -0
  134. package/src/routes/esri/rest.ts +90 -0
  135. package/src/routes/imagery.ts +3 -1
  136. package/src/routes/response.ts +4 -0
  137. package/src/routes/tile.json.ts +44 -0
  138. package/src/routes/tile.style.json.ts +77 -0
  139. package/src/routes/tile.ts +11 -183
  140. package/src/routes/tile.wmts.ts +59 -0
  141. package/src/routes/tile.xyz.ts +30 -0
  142. package/src/tile.set.raster.ts +4 -1
  143. package/src/tile.set.vector.ts +1 -1
  144. package/tsconfig.tsbuildinfo +1 -1
  145. package/dist/node_modules/color-name/.eslintrc.json +0 -43
  146. package/dist/node_modules/color-name/test.js +0 -7
  147. package/dist/node_modules/node-abi/.travis.yml +0 -17
  148. package/dist/node_modules/node-abi/node_modules/semver/CHANGELOG.md +0 -39
  149. package/dist/node_modules/node-abi/node_modules/semver/LICENSE +0 -15
  150. package/dist/node_modules/node-abi/node_modules/semver/README.md +0 -412
  151. package/dist/node_modules/node-abi/node_modules/semver/bin/semver +0 -160
  152. package/dist/node_modules/node-abi/node_modules/semver/package.json +0 -60
  153. package/dist/node_modules/node-abi/node_modules/semver/range.bnf +0 -16
  154. package/dist/node_modules/node-abi/node_modules/semver/semver.js +0 -1483
  155. package/dist/node_modules/node-addon-api/CHANGELOG.md +0 -722
  156. package/dist/node_modules/sharp/build/Release/sharp.node +0 -0
  157. package/dist/node_modules/sharp/vendor/8.10.6/versions.json +0 -31
@@ -1,24 +1,25 @@
1
- var conversions = require('./conversions');
2
- var route = require('./route');
1
+ const conversions = require('./conversions');
2
+ const route = require('./route');
3
3
 
4
- var convert = {};
4
+ const convert = {};
5
5
 
6
- var models = Object.keys(conversions);
6
+ const models = Object.keys(conversions);
7
7
 
8
8
  function wrapRaw(fn) {
9
- var wrappedFn = function (args) {
10
- if (args === undefined || args === null) {
11
- return args;
9
+ const wrappedFn = function (...args) {
10
+ const arg0 = args[0];
11
+ if (arg0 === undefined || arg0 === null) {
12
+ return arg0;
12
13
  }
13
14
 
14
- if (arguments.length > 1) {
15
- args = Array.prototype.slice.call(arguments);
15
+ if (arg0.length > 1) {
16
+ args = arg0;
16
17
  }
17
18
 
18
19
  return fn(args);
19
20
  };
20
21
 
21
- // preserve .conversion property if there is one
22
+ // Preserve .conversion property if there is one
22
23
  if ('conversion' in fn) {
23
24
  wrappedFn.conversion = fn.conversion;
24
25
  }
@@ -27,22 +28,24 @@ function wrapRaw(fn) {
27
28
  }
28
29
 
29
30
  function wrapRounded(fn) {
30
- var wrappedFn = function (args) {
31
- if (args === undefined || args === null) {
32
- return args;
31
+ const wrappedFn = function (...args) {
32
+ const arg0 = args[0];
33
+
34
+ if (arg0 === undefined || arg0 === null) {
35
+ return arg0;
33
36
  }
34
37
 
35
- if (arguments.length > 1) {
36
- args = Array.prototype.slice.call(arguments);
38
+ if (arg0.length > 1) {
39
+ args = arg0;
37
40
  }
38
41
 
39
- var result = fn(args);
42
+ const result = fn(args);
40
43
 
41
- // we're assuming the result is an array here.
44
+ // We're assuming the result is an array here.
42
45
  // see notice in conversions.js; don't use box types
43
46
  // in conversion functions.
44
47
  if (typeof result === 'object') {
45
- for (var len = result.length, i = 0; i < len; i++) {
48
+ for (let len = result.length, i = 0; i < len; i++) {
46
49
  result[i] = Math.round(result[i]);
47
50
  }
48
51
  }
@@ -50,7 +53,7 @@ function wrapRounded(fn) {
50
53
  return result;
51
54
  };
52
55
 
53
- // preserve .conversion property if there is one
56
+ // Preserve .conversion property if there is one
54
57
  if ('conversion' in fn) {
55
58
  wrappedFn.conversion = fn.conversion;
56
59
  }
@@ -58,17 +61,17 @@ function wrapRounded(fn) {
58
61
  return wrappedFn;
59
62
  }
60
63
 
61
- models.forEach(function (fromModel) {
64
+ models.forEach(fromModel => {
62
65
  convert[fromModel] = {};
63
66
 
64
67
  Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
65
68
  Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
66
69
 
67
- var routes = route(fromModel);
68
- var routeModels = Object.keys(routes);
70
+ const routes = route(fromModel);
71
+ const routeModels = Object.keys(routes);
69
72
 
70
- routeModels.forEach(function (toModel) {
71
- var fn = routes[toModel];
73
+ routeModels.forEach(toModel => {
74
+ const fn = routes[toModel];
72
75
 
73
76
  convert[fromModel][toModel] = wrapRounded(fn);
74
77
  convert[fromModel][toModel].raw = wrapRaw(fn);
@@ -1,26 +1,26 @@
1
1
  {
2
- "_from": "color-convert@^1.9.3",
3
- "_id": "color-convert@1.9.3",
2
+ "_from": "color-convert@^2.0.1",
3
+ "_id": "color-convert@2.0.1",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
5
+ "_integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
6
6
  "_location": "/color-convert",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
9
9
  "type": "range",
10
10
  "registry": true,
11
- "raw": "color-convert@^1.9.3",
11
+ "raw": "color-convert@^2.0.1",
12
12
  "name": "color-convert",
13
13
  "escapedName": "color-convert",
14
- "rawSpec": "^1.9.3",
14
+ "rawSpec": "^2.0.1",
15
15
  "saveSpec": null,
16
- "fetchSpec": "^1.9.3"
16
+ "fetchSpec": "^2.0.1"
17
17
  },
18
18
  "_requiredBy": [
19
19
  "/color"
20
20
  ],
21
- "_resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
22
- "_shasum": "bb71850690e1f136567de629d2d5471deda4c1e8",
23
- "_spec": "color-convert@^1.9.3",
21
+ "_resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
22
+ "_shasum": "72d3a68d598c9bdb3af2ad1e84f21d896abd4de3",
23
+ "_spec": "color-convert@^2.0.1",
24
24
  "_where": "/home/runner/work/basemaps/basemaps/packages/lambda-tiler/dist/node_modules/color",
25
25
  "author": {
26
26
  "name": "Heather Arthur",
@@ -31,18 +31,20 @@
31
31
  },
32
32
  "bundleDependencies": false,
33
33
  "dependencies": {
34
- "color-name": "1.1.3"
34
+ "color-name": "~1.1.4"
35
35
  },
36
36
  "deprecated": false,
37
37
  "description": "Plain color conversion functions",
38
38
  "devDependencies": {
39
- "chalk": "1.1.1",
40
- "xo": "0.11.2"
39
+ "chalk": "^2.4.2",
40
+ "xo": "^0.24.0"
41
+ },
42
+ "engines": {
43
+ "node": ">=7.0.0"
41
44
  },
42
45
  "files": [
43
46
  "index.js",
44
47
  "conversions.js",
45
- "css-keywords.js",
46
48
  "route.js"
47
49
  ],
48
50
  "homepage": "https://github.com/Qix-/color-convert#readme",
@@ -70,7 +72,7 @@
70
72
  "pretest": "xo",
71
73
  "test": "node test/basic.js"
72
74
  },
73
- "version": "1.9.3",
75
+ "version": "2.0.1",
74
76
  "xo": {
75
77
  "rules": {
76
78
  "default-case": 0,
@@ -1,7 +1,7 @@
1
- var conversions = require('./conversions');
1
+ const conversions = require('./conversions');
2
2
 
3
3
  /*
4
- this function routes a model to all other models.
4
+ This function routes a model to all other models.
5
5
 
6
6
  all functions that are routed have a property `.conversion` attached
7
7
  to the returned synthetic function. This property is an array
@@ -12,11 +12,11 @@ var conversions = require('./conversions');
12
12
  */
13
13
 
14
14
  function buildGraph() {
15
- var graph = {};
15
+ const graph = {};
16
16
  // https://jsperf.com/object-keys-vs-for-in-with-closure/3
17
- var models = Object.keys(conversions);
17
+ const models = Object.keys(conversions);
18
18
 
19
- for (var len = models.length, i = 0; i < len; i++) {
19
+ for (let len = models.length, i = 0; i < len; i++) {
20
20
  graph[models[i]] = {
21
21
  // http://jsperf.com/1-vs-infinity
22
22
  // micro-opt, but this is simple.
@@ -30,18 +30,18 @@ function buildGraph() {
30
30
 
31
31
  // https://en.wikipedia.org/wiki/Breadth-first_search
32
32
  function deriveBFS(fromModel) {
33
- var graph = buildGraph();
34
- var queue = [fromModel]; // unshift -> queue -> pop
33
+ const graph = buildGraph();
34
+ const queue = [fromModel]; // Unshift -> queue -> pop
35
35
 
36
36
  graph[fromModel].distance = 0;
37
37
 
38
38
  while (queue.length) {
39
- var current = queue.pop();
40
- var adjacents = Object.keys(conversions[current]);
39
+ const current = queue.pop();
40
+ const adjacents = Object.keys(conversions[current]);
41
41
 
42
- for (var len = adjacents.length, i = 0; i < len; i++) {
43
- var adjacent = adjacents[i];
44
- var node = graph[adjacent];
42
+ for (let len = adjacents.length, i = 0; i < len; i++) {
43
+ const adjacent = adjacents[i];
44
+ const node = graph[adjacent];
45
45
 
46
46
  if (node.distance === -1) {
47
47
  node.distance = graph[current].distance + 1;
@@ -61,10 +61,10 @@ function link(from, to) {
61
61
  }
62
62
 
63
63
  function wrapConversion(toModel, graph) {
64
- var path = [graph[toModel].parent, toModel];
65
- var fn = conversions[graph[toModel].parent][toModel];
64
+ const path = [graph[toModel].parent, toModel];
65
+ let fn = conversions[graph[toModel].parent][toModel];
66
66
 
67
- var cur = graph[toModel].parent;
67
+ let cur = graph[toModel].parent;
68
68
  while (graph[cur].parent) {
69
69
  path.unshift(graph[cur].parent);
70
70
  fn = link(conversions[graph[cur].parent][cur], fn);
@@ -76,16 +76,16 @@ function wrapConversion(toModel, graph) {
76
76
  }
77
77
 
78
78
  module.exports = function (fromModel) {
79
- var graph = deriveBFS(fromModel);
80
- var conversion = {};
79
+ const graph = deriveBFS(fromModel);
80
+ const conversion = {};
81
81
 
82
- var models = Object.keys(graph);
83
- for (var len = models.length, i = 0; i < len; i++) {
84
- var toModel = models[i];
85
- var node = graph[toModel];
82
+ const models = Object.keys(graph);
83
+ for (let len = models.length, i = 0; i < len; i++) {
84
+ const toModel = models[i];
85
+ const node = graph[toModel];
86
86
 
87
87
  if (node.parent === null) {
88
- // no possible conversion, or this node is the source model.
88
+ // No possible conversion, or this node is the source model.
89
89
  continue;
90
90
  }
91
91
 
@@ -1,39 +1,42 @@
1
1
  {
2
- "_from": "color-name@1.1.3",
3
- "_id": "color-name@1.1.3",
2
+ "_from": "color-name@~1.1.4",
3
+ "_id": "color-name@1.1.4",
4
4
  "_inBundle": false,
5
- "_integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
5
+ "_integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
6
6
  "_location": "/color-name",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
9
- "type": "version",
9
+ "type": "range",
10
10
  "registry": true,
11
- "raw": "color-name@1.1.3",
11
+ "raw": "color-name@~1.1.4",
12
12
  "name": "color-name",
13
13
  "escapedName": "color-name",
14
- "rawSpec": "1.1.3",
14
+ "rawSpec": "~1.1.4",
15
15
  "saveSpec": null,
16
- "fetchSpec": "1.1.3"
16
+ "fetchSpec": "~1.1.4"
17
17
  },
18
18
  "_requiredBy": [
19
19
  "/color-convert",
20
20
  "/color-string"
21
21
  ],
22
- "_resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
23
- "_shasum": "a7d0558bd89c42f795dd42328f740831ca53bc25",
24
- "_spec": "color-name@1.1.3",
22
+ "_resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
23
+ "_shasum": "c2a09a87acbde69543de6f63fa3995c826c536a2",
24
+ "_spec": "color-name@~1.1.4",
25
25
  "_where": "/home/runner/work/basemaps/basemaps/packages/lambda-tiler/dist/node_modules/color-convert",
26
26
  "author": {
27
27
  "name": "DY",
28
28
  "email": "dfcreative@gmail.com"
29
29
  },
30
30
  "bugs": {
31
- "url": "https://github.com/dfcreative/color-name/issues"
31
+ "url": "https://github.com/colorjs/color-name/issues"
32
32
  },
33
33
  "bundleDependencies": false,
34
34
  "deprecated": false,
35
35
  "description": "A list of color names and its values",
36
- "homepage": "https://github.com/dfcreative/color-name",
36
+ "files": [
37
+ "index.js"
38
+ ],
39
+ "homepage": "https://github.com/colorjs/color-name",
37
40
  "keywords": [
38
41
  "color-name",
39
42
  "color",
@@ -45,10 +48,10 @@
45
48
  "name": "color-name",
46
49
  "repository": {
47
50
  "type": "git",
48
- "url": "git+ssh://git@github.com/dfcreative/color-name.git"
51
+ "url": "git+ssh://git@github.com/colorjs/color-name.git"
49
52
  },
50
53
  "scripts": {
51
54
  "test": "node test.js"
52
55
  },
53
- "version": "1.1.3"
56
+ "version": "1.1.4"
54
57
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "_from": "color-string@^1.6.0",
2
+ "_from": "color-string@^1.9.0",
3
3
  "_id": "color-string@1.9.0",
4
4
  "_inBundle": false,
5
5
  "_integrity": "sha512-9Mrz2AQLefkH1UvASKj6v6hj/7eWgjnT/cVsR8CumieLoT+g900exWeNogqtweI8dxloXN9BDQTYro1oWu/5CQ==",
@@ -8,19 +8,19 @@
8
8
  "_requested": {
9
9
  "type": "range",
10
10
  "registry": true,
11
- "raw": "color-string@^1.6.0",
11
+ "raw": "color-string@^1.9.0",
12
12
  "name": "color-string",
13
13
  "escapedName": "color-string",
14
- "rawSpec": "^1.6.0",
14
+ "rawSpec": "^1.9.0",
15
15
  "saveSpec": null,
16
- "fetchSpec": "^1.6.0"
16
+ "fetchSpec": "^1.9.0"
17
17
  },
18
18
  "_requiredBy": [
19
19
  "/color"
20
20
  ],
21
21
  "_resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.0.tgz",
22
22
  "_shasum": "63b6ebd1bec11999d1df3a79a7569451ac2be8aa",
23
- "_spec": "color-string@^1.6.0",
23
+ "_spec": "color-string@^1.9.0",
24
24
  "_where": "/home/runner/work/basemaps/basemaps/packages/lambda-tiler/dist/node_modules/color",
25
25
  "author": {
26
26
  "name": "Heather Arthur",
@@ -1,29 +1,22 @@
1
1
  /// <reference types="node"/>
2
2
  import {IncomingMessage} from 'http';
3
3
 
4
- declare const decompressResponse: {
5
- /**
6
- Decompress a HTTP response if needed.
4
+ /**
5
+ Decompress a HTTP response if needed.
7
6
 
8
- @param response - The HTTP incoming stream with compressed data.
9
- @returns The decompressed HTTP response stream.
7
+ @param response - The HTTP incoming stream with compressed data.
8
+ @returns The decompressed HTTP response stream.
10
9
 
11
- @example
12
- ```
13
- import {http} from 'http';
14
- import decompressResponse = require('decompress-response');
10
+ @example
11
+ ```
12
+ import {http} from 'http';
13
+ import decompressResponse = require('decompress-response');
15
14
 
16
- http.get('https://sindresorhus.com', response => {
17
- response = decompressResponse(response);
18
- });
19
- ```
20
- */
21
- (response: IncomingMessage): IncomingMessage;
22
-
23
- // TODO: remove this in the next major version, refactor the whole definition to:
24
- // declare function decompressResponse(response: IncomingMessage): IncomingMessage;
25
- // export = decompressResponse;
26
- default: typeof decompressResponse;
27
- };
15
+ http.get('https://sindresorhus.com', response => {
16
+ response = decompressResponse(response);
17
+ });
18
+ ```
19
+ */
20
+ declare function decompressResponse(response: IncomingMessage): IncomingMessage;
28
21
 
29
22
  export = decompressResponse;
@@ -1,40 +1,58 @@
1
1
  'use strict';
2
- const {PassThrough: PassThroughStream} = require('stream');
2
+ const {Transform, PassThrough} = require('stream');
3
3
  const zlib = require('zlib');
4
4
  const mimicResponse = require('mimic-response');
5
5
 
6
- const decompressResponse = response => {
6
+ module.exports = response => {
7
7
  const contentEncoding = (response.headers['content-encoding'] || '').toLowerCase();
8
8
 
9
9
  if (!['gzip', 'deflate', 'br'].includes(contentEncoding)) {
10
10
  return response;
11
11
  }
12
12
 
13
+ // TODO: Remove this when targeting Node.js 12.
13
14
  const isBrotli = contentEncoding === 'br';
14
15
  if (isBrotli && typeof zlib.createBrotliDecompress !== 'function') {
16
+ response.destroy(new Error('Brotli is not supported on Node.js < 12'));
15
17
  return response;
16
18
  }
17
19
 
18
- const decompress = isBrotli ? zlib.createBrotliDecompress() : zlib.createUnzip();
19
- const stream = new PassThroughStream();
20
+ let isEmpty = true;
20
21
 
21
- mimicResponse(response, stream);
22
+ const checker = new Transform({
23
+ transform(data, _encoding, callback) {
24
+ isEmpty = false;
22
25
 
23
- decompress.on('error', error => {
24
- // Ignore empty response
25
- if (error.code === 'Z_BUF_ERROR') {
26
- stream.end();
26
+ callback(null, data);
27
+ },
28
+
29
+ flush(callback) {
30
+ callback();
31
+ }
32
+ });
33
+
34
+ const finalStream = new PassThrough({
35
+ autoDestroy: false,
36
+ destroy(error, callback) {
37
+ response.destroy();
38
+
39
+ callback(error);
40
+ }
41
+ });
42
+
43
+ const decompressStream = isBrotli ? zlib.createBrotliDecompress() : zlib.createUnzip();
44
+
45
+ decompressStream.once('error', error => {
46
+ if (isEmpty && !response.readable) {
47
+ finalStream.end();
27
48
  return;
28
49
  }
29
50
 
30
- stream.emit('error', error);
51
+ finalStream.destroy(error);
31
52
  });
32
53
 
33
- response.pipe(decompress).pipe(stream);
54
+ mimicResponse(response, finalStream);
55
+ response.pipe(checker).pipe(decompressStream).pipe(finalStream);
34
56
 
35
- return stream;
57
+ return finalStream;
36
58
  };
37
-
38
- module.exports = decompressResponse;
39
- // TODO: remove this in the next major version
40
- module.exports.default = decompressResponse;
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
@@ -1,56 +1,57 @@
1
1
  {
2
- "_from": "decompress-response@^4.2.0",
3
- "_id": "decompress-response@4.2.1",
2
+ "_from": "decompress-response@^6.0.0",
3
+ "_id": "decompress-response@6.0.0",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==",
5
+ "_integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",
6
6
  "_location": "/decompress-response",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
9
9
  "type": "range",
10
10
  "registry": true,
11
- "raw": "decompress-response@^4.2.0",
11
+ "raw": "decompress-response@^6.0.0",
12
12
  "name": "decompress-response",
13
13
  "escapedName": "decompress-response",
14
- "rawSpec": "^4.2.0",
14
+ "rawSpec": "^6.0.0",
15
15
  "saveSpec": null,
16
- "fetchSpec": "^4.2.0"
16
+ "fetchSpec": "^6.0.0"
17
17
  },
18
18
  "_requiredBy": [
19
19
  "/simple-get"
20
20
  ],
21
- "_resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz",
22
- "_shasum": "414023cc7a302da25ce2ec82d0d5238ccafd8986",
23
- "_spec": "decompress-response@^4.2.0",
21
+ "_resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
22
+ "_shasum": "ca387612ddb7e104bd16d85aab00d5ecf09c66fc",
23
+ "_spec": "decompress-response@^6.0.0",
24
24
  "_where": "/home/runner/work/basemaps/basemaps/packages/lambda-tiler/dist/node_modules/simple-get",
25
25
  "author": {
26
26
  "name": "Sindre Sorhus",
27
27
  "email": "sindresorhus@gmail.com",
28
- "url": "sindresorhus.com"
28
+ "url": "https://sindresorhus.com"
29
29
  },
30
30
  "bugs": {
31
31
  "url": "https://github.com/sindresorhus/decompress-response/issues"
32
32
  },
33
33
  "bundleDependencies": false,
34
34
  "dependencies": {
35
- "mimic-response": "^2.0.0"
35
+ "mimic-response": "^3.1.0"
36
36
  },
37
37
  "deprecated": false,
38
38
  "description": "Decompress a HTTP response if needed",
39
39
  "devDependencies": {
40
- "@types/node": "^12.7.1",
40
+ "@types/node": "^14.0.1",
41
41
  "ava": "^2.2.0",
42
42
  "get-stream": "^5.0.0",
43
- "pify": "^4.0.1",
44
- "tsd": "^0.7.1",
45
- "xo": "^0.24.0"
43
+ "pify": "^5.0.0",
44
+ "tsd": "^0.11.0",
45
+ "xo": "^0.30.0"
46
46
  },
47
47
  "engines": {
48
- "node": ">=8"
48
+ "node": ">=10"
49
49
  },
50
50
  "files": [
51
51
  "index.js",
52
52
  "index.d.ts"
53
53
  ],
54
+ "funding": "https://github.com/sponsors/sindresorhus",
54
55
  "homepage": "https://github.com/sindresorhus/decompress-response#readme",
55
56
  "keywords": [
56
57
  "decompress",
@@ -78,5 +79,10 @@
78
79
  "scripts": {
79
80
  "test": "xo && ava && tsd"
80
81
  },
81
- "version": "4.2.1"
82
+ "version": "6.0.0",
83
+ "xo": {
84
+ "rules": {
85
+ "@typescript-eslint/prefer-readonly-parameter-types": "off"
86
+ }
87
+ }
82
88
  }
@@ -1,4 +1,4 @@
1
- # decompress-response [![Build Status](https://travis-ci.org/sindresorhus/decompress-response.svg?branch=master)](https://travis-ci.org/sindresorhus/decompress-response)
1
+ # decompress-response [![Build Status](https://travis-ci.com/sindresorhus/decompress-response.svg?branch=master)](https://travis-ci.com/sindresorhus/decompress-response)
2
2
 
3
3
  > Decompress a HTTP response if needed
4
4
 
@@ -6,14 +6,12 @@ Decompresses the [response](https://nodejs.org/api/http.html#http_class_http_inc
6
6
 
7
7
  Used by [`got`](https://github.com/sindresorhus/got).
8
8
 
9
-
10
9
  ## Install
11
10
 
12
11
  ```
13
12
  $ npm install decompress-response
14
13
  ```
15
14
 
16
-
17
15
  ## Usage
18
16
 
19
17
  ```js
@@ -25,7 +23,6 @@ http.get('https://sindresorhus.com', response => {
25
23
  });
26
24
  ```
27
25
 
28
-
29
26
  ## API
30
27
 
31
28
  ### decompressResponse(response)
@@ -38,12 +35,11 @@ Type: [`http.IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_
38
35
 
39
36
  The HTTP incoming stream with compressed data.
40
37
 
41
-
42
38
  ---
43
39
 
44
40
  <div align="center">
45
41
  <b>
46
- <a href="https://tidelift.com/subscription/pkg/npm-unzip-response?utm_source=npm-unzip-response&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
42
+ <a href="https://tidelift.com/subscription/pkg/npm-decompress-response?utm_source=npm-decompress-response&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
47
43
  </b>
48
44
  <br>
49
45
  <sub>
@@ -16,7 +16,6 @@
16
16
  "fetchSpec": "^1.0.3"
17
17
  },
18
18
  "_requiredBy": [
19
- "/prebuild-install",
20
19
  "/sharp"
21
20
  ],
22
21
  "_resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
@@ -10,8 +10,8 @@ Makes `toStream` include the properties from `fromStream`.
10
10
  @return The same object as `toStream`.
11
11
  */
12
12
  declare function mimicResponse<T extends NodeJS.ReadableStream>(
13
- fromStream: IncomingMessage,
13
+ fromStream: IncomingMessage, // eslint-disable-line @typescript-eslint/prefer-readonly-parameter-types
14
14
  toStream: T,
15
- ): IncomingMessage & T;
15
+ ): T & IncomingMessage;
16
16
 
17
17
  export = mimicResponse;