ipx 1.0.0-0 → 1.0.0-2
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/dist/cli.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const consola = require('consola');
|
|
4
4
|
const listhen = require('listhen');
|
|
5
|
-
const middleware = require('./shared/ipx.
|
|
5
|
+
const middleware = require('./shared/ipx.399255f0.cjs');
|
|
6
6
|
require('defu');
|
|
7
7
|
require('image-meta');
|
|
8
8
|
require('ufo');
|
|
@@ -10,7 +10,7 @@ require('node:fs');
|
|
|
10
10
|
require('pathe');
|
|
11
11
|
require('node:http');
|
|
12
12
|
require('node:https');
|
|
13
|
-
require('
|
|
13
|
+
require('node-fetch-native');
|
|
14
14
|
require('destr');
|
|
15
15
|
require('etag');
|
|
16
16
|
require('xss');
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import consola from 'consola';
|
|
2
2
|
import { listen } from 'listhen';
|
|
3
|
-
import { c as createIPX, a as createIPXMiddleware } from './shared/ipx.
|
|
3
|
+
import { c as createIPX, a as createIPXMiddleware } from './shared/ipx.d1cfdfa2.mjs';
|
|
4
4
|
import 'defu';
|
|
5
5
|
import 'image-meta';
|
|
6
6
|
import 'ufo';
|
|
@@ -8,7 +8,7 @@ import 'node:fs';
|
|
|
8
8
|
import 'pathe';
|
|
9
9
|
import 'node:http';
|
|
10
10
|
import 'node:https';
|
|
11
|
-
import '
|
|
11
|
+
import 'node-fetch-native';
|
|
12
12
|
import 'destr';
|
|
13
13
|
import 'etag';
|
|
14
14
|
import 'xss';
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const middleware = require('./shared/ipx.
|
|
3
|
+
const middleware = require('./shared/ipx.399255f0.cjs');
|
|
4
4
|
require('defu');
|
|
5
5
|
require('image-meta');
|
|
6
6
|
require('ufo');
|
|
@@ -8,7 +8,7 @@ require('node:fs');
|
|
|
8
8
|
require('pathe');
|
|
9
9
|
require('node:http');
|
|
10
10
|
require('node:https');
|
|
11
|
-
require('
|
|
11
|
+
require('node-fetch-native');
|
|
12
12
|
require('destr');
|
|
13
13
|
require('etag');
|
|
14
14
|
require('xss');
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as createIPX, a as createIPXMiddleware, h as handleRequest } from './shared/ipx.
|
|
1
|
+
export { c as createIPX, a as createIPXMiddleware, h as handleRequest } from './shared/ipx.d1cfdfa2.mjs';
|
|
2
2
|
import 'defu';
|
|
3
3
|
import 'image-meta';
|
|
4
4
|
import 'ufo';
|
|
@@ -6,7 +6,7 @@ import 'node:fs';
|
|
|
6
6
|
import 'pathe';
|
|
7
7
|
import 'node:http';
|
|
8
8
|
import 'node:https';
|
|
9
|
-
import '
|
|
9
|
+
import 'node-fetch-native';
|
|
10
10
|
import 'destr';
|
|
11
11
|
import 'etag';
|
|
12
12
|
import 'xss';
|
|
@@ -7,7 +7,7 @@ const node_fs = require('node:fs');
|
|
|
7
7
|
const pathe = require('pathe');
|
|
8
8
|
const http = require('node:http');
|
|
9
9
|
const https = require('node:https');
|
|
10
|
-
const
|
|
10
|
+
const nodeFetchNative = require('node-fetch-native');
|
|
11
11
|
const destr = require('destr');
|
|
12
12
|
const getEtag = require('etag');
|
|
13
13
|
const xss = require('xss');
|
|
@@ -127,7 +127,7 @@ const createHTTPSource = (options) => {
|
|
|
127
127
|
if (!requestOptions?.bypassDomain && !domains.has(hostname)) {
|
|
128
128
|
throw createError("Forbidden host", 403, hostname);
|
|
129
129
|
}
|
|
130
|
-
const response = await
|
|
130
|
+
const response = await nodeFetchNative.fetch(id, {
|
|
131
131
|
agent: id.startsWith("https") ? httpsAgent : httpAgent,
|
|
132
132
|
...options.fetchOptions
|
|
133
133
|
});
|
|
@@ -397,7 +397,7 @@ function createIPX(userOptions) {
|
|
|
397
397
|
maxAge: getEnv("IPX_MAX_AGE", 300),
|
|
398
398
|
sharp: {}
|
|
399
399
|
};
|
|
400
|
-
const options = defu(userOptions, defaults);
|
|
400
|
+
const options = defu.defu(userOptions, defaults);
|
|
401
401
|
options.alias = Object.fromEntries(Object.entries(options.alias).map((e) => [ufo.withLeadingSlash(e[0]), e[1]]));
|
|
402
402
|
const context = {
|
|
403
403
|
sources: {}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import defu from 'defu';
|
|
1
|
+
import { defu } from 'defu';
|
|
2
2
|
import { imageMeta } from 'image-meta';
|
|
3
3
|
import { withLeadingSlash, hasProtocol, joinURL, decode } from 'ufo';
|
|
4
4
|
import { promises } from 'node:fs';
|
|
5
5
|
import { resolve, join, parse } from 'pathe';
|
|
6
6
|
import http from 'node:http';
|
|
7
7
|
import https from 'node:https';
|
|
8
|
-
import { fetch } from '
|
|
8
|
+
import { fetch } from 'node-fetch-native';
|
|
9
9
|
import destr from 'destr';
|
|
10
10
|
import getEtag from 'etag';
|
|
11
11
|
import xss from 'xss';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ipx",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-2",
|
|
4
4
|
"repository": "unjs/ipx",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"exports": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"etag": "^1.8.1",
|
|
34
34
|
"image-meta": "^0.1.1",
|
|
35
35
|
"listhen": "^1.0.0",
|
|
36
|
-
"
|
|
36
|
+
"node-fetch-native": "^1.0.1",
|
|
37
37
|
"pathe": "^1.0.0",
|
|
38
38
|
"sharp": "^0.31.2",
|
|
39
39
|
"ufo": "^1.0.0",
|