@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.
- package/CHANGELOG.md +12 -0
- package/LICENSE +2 -2
- package/build/__test__/tile.style.json.test.d.ts +2 -0
- package/build/__test__/tile.style.json.test.d.ts.map +1 -0
- package/build/__test__/tile.style.json.test.js +33 -0
- package/build/__test__/xyz.test.js +24 -23
- package/build/cli/dump.js +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -0
- package/build/routes/esri/rest.d.ts +10 -0
- package/build/routes/esri/rest.d.ts.map +1 -0
- package/build/routes/esri/rest.js +87 -0
- package/build/routes/imagery.d.ts +2 -0
- package/build/routes/imagery.d.ts.map +1 -1
- package/build/routes/imagery.js +3 -1
- package/build/routes/response.d.ts +4 -0
- package/build/routes/response.d.ts.map +1 -0
- package/build/routes/response.js +3 -0
- package/build/routes/tile.d.ts +0 -20
- package/build/routes/tile.d.ts.map +1 -1
- package/build/routes/tile.js +11 -161
- package/build/routes/tile.json.d.ts +10 -0
- package/build/routes/tile.json.d.ts.map +1 -0
- package/build/routes/tile.json.js +31 -0
- package/build/routes/tile.style.json.d.ts +10 -0
- package/build/routes/tile.style.json.d.ts.map +1 -0
- package/build/routes/tile.style.json.js +74 -0
- package/build/routes/tile.wmts.d.ts +9 -0
- package/build/routes/tile.wmts.d.ts.map +1 -0
- package/build/routes/tile.wmts.js +57 -0
- package/build/routes/tile.xyz.d.ts +13 -0
- package/build/routes/tile.xyz.d.ts.map +1 -0
- package/build/routes/tile.xyz.js +28 -0
- package/build/tile.set.raster.d.ts +2 -0
- package/build/tile.set.raster.d.ts.map +1 -1
- package/build/tile.set.raster.js +3 -1
- package/build/tile.set.vector.js +1 -1
- package/dist/index.js +10545 -9583
- package/dist/node_modules/color/README.md +7 -7
- package/dist/node_modules/color/index.js +173 -158
- package/dist/node_modules/color/package.json +18 -16
- package/dist/node_modules/color-convert/conversions.js +281 -310
- package/dist/node_modules/color-convert/index.js +27 -24
- package/dist/node_modules/color-convert/package.json +16 -14
- package/dist/node_modules/color-convert/route.js +22 -22
- package/dist/node_modules/color-name/package.json +17 -14
- package/dist/node_modules/color-string/package.json +5 -5
- package/dist/node_modules/decompress-response/index.d.ts +14 -21
- package/dist/node_modules/decompress-response/index.js +34 -16
- package/dist/node_modules/decompress-response/license +1 -1
- package/dist/node_modules/decompress-response/package.json +23 -17
- package/dist/node_modules/decompress-response/readme.md +2 -6
- package/dist/node_modules/detect-libc/package.json +0 -1
- package/dist/node_modules/mimic-response/index.d.ts +2 -2
- package/dist/node_modules/mimic-response/index.js +41 -2
- package/dist/node_modules/mimic-response/package.json +17 -17
- package/dist/node_modules/mimic-response/readme.md +22 -1
- package/dist/node_modules/node-abi/.circleci/config.yml +63 -0
- package/dist/node_modules/node-abi/.releaserc.json +9 -0
- package/dist/node_modules/node-abi/abi_registry.json +39 -4
- package/dist/node_modules/node-abi/index.js +5 -2
- package/dist/node_modules/node-abi/package.json +17 -16
- package/dist/node_modules/node-abi/test/index.js +7 -15
- package/dist/node_modules/node-addon-api/README.md +2 -2
- package/dist/node_modules/node-addon-api/except.gypi +20 -11
- package/dist/node_modules/node-addon-api/napi-inl.h +734 -196
- package/dist/node_modules/node-addon-api/napi.h +420 -164
- package/dist/node_modules/node-addon-api/noexcept.gypi +21 -11
- package/dist/node_modules/node-addon-api/package.json +43 -14
- package/dist/node_modules/node-addon-api/tools/clang-format.js +18 -17
- package/dist/node_modules/node-addon-api/tools/eslint-format.js +71 -0
- package/dist/node_modules/prebuild-install/CHANGELOG.md +24 -7
- package/dist/node_modules/prebuild-install/README.md +24 -4
- package/dist/node_modules/prebuild-install/asset.js +10 -10
- package/dist/node_modules/prebuild-install/bin.js +13 -13
- package/dist/node_modules/prebuild-install/download.js +22 -22
- package/dist/node_modules/prebuild-install/log.js +4 -4
- package/dist/node_modules/prebuild-install/node_modules/detect-libc/LICENSE +201 -0
- package/dist/node_modules/prebuild-install/node_modules/detect-libc/README.md +160 -0
- package/dist/node_modules/prebuild-install/node_modules/detect-libc/index.d.ts +11 -0
- package/dist/node_modules/prebuild-install/node_modules/detect-libc/lib/detect-libc.js +178 -0
- package/dist/node_modules/prebuild-install/node_modules/detect-libc/lib/process.js +16 -0
- package/dist/node_modules/prebuild-install/node_modules/detect-libc/package.json +71 -0
- package/dist/node_modules/prebuild-install/package.json +18 -19
- package/dist/node_modules/prebuild-install/proxy.js +10 -10
- package/dist/node_modules/prebuild-install/rc.js +12 -12
- package/dist/node_modules/prebuild-install/util.js +14 -14
- package/dist/node_modules/semver/package.json +1 -0
- package/dist/node_modules/sharp/README.md +2 -2
- package/dist/node_modules/sharp/binding.gyp +12 -9
- package/dist/node_modules/sharp/build/Release/sharp-linux-x64.node +0 -0
- package/dist/node_modules/sharp/install/dll-copy.js +6 -6
- package/dist/node_modules/sharp/install/libvips.js +4 -8
- package/dist/node_modules/sharp/lib/channel.js +11 -7
- package/dist/node_modules/sharp/lib/colour.js +42 -1
- package/dist/node_modules/sharp/lib/constructor.js +18 -31
- package/dist/node_modules/sharp/lib/input.js +45 -3
- package/dist/node_modules/sharp/lib/is.js +19 -5
- package/dist/node_modules/sharp/lib/libvips.js +4 -19
- package/dist/node_modules/sharp/lib/operation.js +28 -5
- package/dist/node_modules/sharp/lib/output.js +147 -16
- package/dist/node_modules/sharp/lib/sharp.js +31 -0
- package/dist/node_modules/sharp/lib/utility.js +3 -2
- package/dist/node_modules/sharp/package.json +32 -23
- package/dist/node_modules/sharp/src/common.cc +67 -11
- package/dist/node_modules/sharp/src/common.h +25 -5
- package/dist/node_modules/sharp/src/libvips/cplusplus/VConnection.cpp +0 -26
- package/dist/node_modules/sharp/src/libvips/cplusplus/VImage.cpp +54 -16
- package/dist/node_modules/sharp/src/libvips/cplusplus/VInterpolate.cpp +0 -13
- package/dist/node_modules/sharp/src/libvips/cplusplus/vips-operators.cpp +185 -1
- package/dist/node_modules/sharp/src/metadata.cc +14 -0
- package/dist/node_modules/sharp/src/metadata.h +1 -0
- package/dist/node_modules/sharp/src/operations.cc +29 -3
- package/dist/node_modules/sharp/src/operations.h +13 -2
- package/dist/node_modules/sharp/src/pipeline.cc +103 -35
- package/dist/node_modules/sharp/src/pipeline.h +23 -3
- package/dist/node_modules/sharp/src/utilities.cc +1 -1
- package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/THIRD-PARTY-NOTICES.md +2 -3
- package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/lib/libvips-cpp.so.42 +0 -0
- package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/platform.json +0 -0
- package/dist/node_modules/sharp/vendor/8.11.3/linux-x64/versions.json +30 -0
- package/dist/node_modules/simple-get/.github/dependabot.yml +15 -0
- package/dist/node_modules/simple-get/.github/workflows/ci.yml +23 -0
- package/dist/node_modules/simple-get/README.md +17 -3
- package/dist/node_modules/simple-get/index.js +9 -0
- package/dist/node_modules/simple-get/package.json +27 -13
- package/dist/package-lock.json +51 -51
- package/dist/package.json +9 -9
- package/package.json +10 -10
- package/src/__test__/tile.style.json.test.ts +40 -0
- package/src/__test__/xyz.test.ts +32 -30
- package/src/cli/dump.ts +2 -2
- package/src/index.ts +2 -0
- package/src/routes/esri/rest.ts +90 -0
- package/src/routes/imagery.ts +3 -1
- package/src/routes/response.ts +4 -0
- package/src/routes/tile.json.ts +44 -0
- package/src/routes/tile.style.json.ts +77 -0
- package/src/routes/tile.ts +11 -183
- package/src/routes/tile.wmts.ts +59 -0
- package/src/routes/tile.xyz.ts +30 -0
- package/src/tile.set.raster.ts +4 -1
- package/src/tile.set.vector.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/node_modules/color-name/.eslintrc.json +0 -43
- package/dist/node_modules/color-name/test.js +0 -7
- package/dist/node_modules/node-abi/.travis.yml +0 -17
- package/dist/node_modules/node-abi/node_modules/semver/CHANGELOG.md +0 -39
- package/dist/node_modules/node-abi/node_modules/semver/LICENSE +0 -15
- package/dist/node_modules/node-abi/node_modules/semver/README.md +0 -412
- package/dist/node_modules/node-abi/node_modules/semver/bin/semver +0 -160
- package/dist/node_modules/node-abi/node_modules/semver/package.json +0 -60
- package/dist/node_modules/node-abi/node_modules/semver/range.bnf +0 -16
- package/dist/node_modules/node-abi/node_modules/semver/semver.js +0 -1483
- package/dist/node_modules/node-addon-api/CHANGELOG.md +0 -722
- package/dist/node_modules/sharp/build/Release/sharp.node +0 -0
- package/dist/node_modules/sharp/vendor/8.10.6/versions.json +0 -31
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const conversions = require('./conversions');
|
|
2
|
+
const route = require('./route');
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const convert = {};
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const models = Object.keys(conversions);
|
|
7
7
|
|
|
8
8
|
function wrapRaw(fn) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 (
|
|
15
|
-
args =
|
|
15
|
+
if (arg0.length > 1) {
|
|
16
|
+
args = arg0;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
return fn(args);
|
|
19
20
|
};
|
|
20
21
|
|
|
21
|
-
//
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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 (
|
|
36
|
-
args =
|
|
38
|
+
if (arg0.length > 1) {
|
|
39
|
+
args = arg0;
|
|
37
40
|
}
|
|
38
41
|
|
|
39
|
-
|
|
42
|
+
const result = fn(args);
|
|
40
43
|
|
|
41
|
-
//
|
|
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 (
|
|
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
|
-
//
|
|
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(
|
|
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
|
-
|
|
68
|
-
|
|
70
|
+
const routes = route(fromModel);
|
|
71
|
+
const routeModels = Object.keys(routes);
|
|
69
72
|
|
|
70
|
-
routeModels.forEach(
|
|
71
|
-
|
|
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@^
|
|
3
|
-
"_id": "color-convert@
|
|
2
|
+
"_from": "color-convert@^2.0.1",
|
|
3
|
+
"_id": "color-convert@2.0.1",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
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@^
|
|
11
|
+
"raw": "color-convert@^2.0.1",
|
|
12
12
|
"name": "color-convert",
|
|
13
13
|
"escapedName": "color-convert",
|
|
14
|
-
"rawSpec": "^
|
|
14
|
+
"rawSpec": "^2.0.1",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "^
|
|
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-
|
|
22
|
-
"_shasum": "
|
|
23
|
-
"_spec": "color-convert@^
|
|
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.
|
|
34
|
+
"color-name": "~1.1.4"
|
|
35
35
|
},
|
|
36
36
|
"deprecated": false,
|
|
37
37
|
"description": "Plain color conversion functions",
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"chalk": "
|
|
40
|
-
"xo": "0.
|
|
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": "
|
|
75
|
+
"version": "2.0.1",
|
|
74
76
|
"xo": {
|
|
75
77
|
"rules": {
|
|
76
78
|
"default-case": 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
const conversions = require('./conversions');
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
|
-
|
|
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
|
-
|
|
15
|
+
const graph = {};
|
|
16
16
|
// https://jsperf.com/object-keys-vs-for-in-with-closure/3
|
|
17
|
-
|
|
17
|
+
const models = Object.keys(conversions);
|
|
18
18
|
|
|
19
|
-
for (
|
|
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
|
-
|
|
34
|
-
|
|
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
|
-
|
|
40
|
-
|
|
39
|
+
const current = queue.pop();
|
|
40
|
+
const adjacents = Object.keys(conversions[current]);
|
|
41
41
|
|
|
42
|
-
for (
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
65
|
-
|
|
64
|
+
const path = [graph[toModel].parent, toModel];
|
|
65
|
+
let fn = conversions[graph[toModel].parent][toModel];
|
|
66
66
|
|
|
67
|
-
|
|
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
|
-
|
|
80
|
-
|
|
79
|
+
const graph = deriveBFS(fromModel);
|
|
80
|
+
const conversion = {};
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
for (
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
//
|
|
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
|
|
3
|
-
"_id": "color-name@1.1.
|
|
2
|
+
"_from": "color-name@~1.1.4",
|
|
3
|
+
"_id": "color-name@1.1.4",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "
|
|
5
|
+
"_integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
|
6
6
|
"_location": "/color-name",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
9
|
-
"type": "
|
|
9
|
+
"type": "range",
|
|
10
10
|
"registry": true,
|
|
11
|
-
"raw": "color-name
|
|
11
|
+
"raw": "color-name@~1.1.4",
|
|
12
12
|
"name": "color-name",
|
|
13
13
|
"escapedName": "color-name",
|
|
14
|
-
"rawSpec": "1.1.
|
|
14
|
+
"rawSpec": "~1.1.4",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "1.1.
|
|
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.
|
|
23
|
-
"_shasum": "
|
|
24
|
-
"_spec": "color-name
|
|
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/
|
|
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
|
-
"
|
|
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/
|
|
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.
|
|
56
|
+
"version": "1.1.4"
|
|
54
57
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_from": "color-string@^1.
|
|
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.
|
|
11
|
+
"raw": "color-string@^1.9.0",
|
|
12
12
|
"name": "color-string",
|
|
13
13
|
"escapedName": "color-string",
|
|
14
|
-
"rawSpec": "^1.
|
|
14
|
+
"rawSpec": "^1.9.0",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "^1.
|
|
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.
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
Decompress a HTTP response if needed.
|
|
4
|
+
/**
|
|
5
|
+
Decompress a HTTP response if needed.
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
@param response - The HTTP incoming stream with compressed data.
|
|
8
|
+
@returns The decompressed HTTP response stream.
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
@example
|
|
11
|
+
```
|
|
12
|
+
import {http} from 'http';
|
|
13
|
+
import decompressResponse = require('decompress-response');
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
2
|
+
const {Transform, PassThrough} = require('stream');
|
|
3
3
|
const zlib = require('zlib');
|
|
4
4
|
const mimicResponse = require('mimic-response');
|
|
5
5
|
|
|
6
|
-
|
|
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
|
-
|
|
19
|
-
const stream = new PassThroughStream();
|
|
20
|
+
let isEmpty = true;
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
const checker = new Transform({
|
|
23
|
+
transform(data, _encoding, callback) {
|
|
24
|
+
isEmpty = false;
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
51
|
+
finalStream.destroy(error);
|
|
31
52
|
});
|
|
32
53
|
|
|
33
|
-
response
|
|
54
|
+
mimicResponse(response, finalStream);
|
|
55
|
+
response.pipe(checker).pipe(decompressStream).pipe(finalStream);
|
|
34
56
|
|
|
35
|
-
return
|
|
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@^
|
|
3
|
-
"_id": "decompress-response@
|
|
2
|
+
"_from": "decompress-response@^6.0.0",
|
|
3
|
+
"_id": "decompress-response@6.0.0",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
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@^
|
|
11
|
+
"raw": "decompress-response@^6.0.0",
|
|
12
12
|
"name": "decompress-response",
|
|
13
13
|
"escapedName": "decompress-response",
|
|
14
|
-
"rawSpec": "^
|
|
14
|
+
"rawSpec": "^6.0.0",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "^
|
|
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-
|
|
22
|
-
"_shasum": "
|
|
23
|
-
"_spec": "decompress-response@^
|
|
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": "^
|
|
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": "^
|
|
40
|
+
"@types/node": "^14.0.1",
|
|
41
41
|
"ava": "^2.2.0",
|
|
42
42
|
"get-stream": "^5.0.0",
|
|
43
|
-
"pify": "^
|
|
44
|
-
"tsd": "^0.
|
|
45
|
-
"xo": "^0.
|
|
43
|
+
"pify": "^5.0.0",
|
|
44
|
+
"tsd": "^0.11.0",
|
|
45
|
+
"xo": "^0.30.0"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
|
-
"node": ">=
|
|
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": "
|
|
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 [](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-
|
|
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>
|
|
@@ -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
|
-
):
|
|
15
|
+
): T & IncomingMessage;
|
|
16
16
|
|
|
17
17
|
export = mimicResponse;
|