phecda-server 5.2.2 → 5.2.4
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/bin/cli.mjs +1 -0
- package/dist/{chunk-VMLHTEW3.js → chunk-AWY6FTH4.js} +38 -38
- package/dist/{chunk-ZP7HNASU.js → chunk-FNJWO324.js} +1 -1
- package/dist/{chunk-BSE2DSDK.js → chunk-H6NYBVBV.js} +64 -64
- package/dist/{chunk-V3WIKOP3.mjs → chunk-IJNA24EZ.mjs} +2 -2
- package/dist/{chunk-CKQW3FDK.mjs → chunk-LGP5AT6W.mjs} +7 -4
- package/dist/{chunk-JE6BBDXW.mjs → chunk-Q4AGVGVA.mjs} +1 -1
- package/dist/{chunk-5BVUCNMA.js → chunk-UJAI73O6.js} +24 -21
- package/dist/{chunk-VLV3AO3H.mjs → chunk-VYDBNZJ2.mjs} +1 -1
- package/dist/helper.js +3 -3
- package/dist/helper.mjs +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +54 -48
- package/dist/index.mjs +20 -14
- package/dist/rpc/bullmq/index.js +12 -12
- package/dist/rpc/bullmq/index.mjs +2 -2
- package/dist/rpc/kafka/index.js +10 -10
- package/dist/rpc/kafka/index.mjs +2 -2
- package/dist/rpc/nats/index.js +12 -11
- package/dist/rpc/nats/index.mjs +3 -2
- package/dist/rpc/rabbitmq/index.js +13 -13
- package/dist/rpc/rabbitmq/index.mjs +2 -2
- package/dist/rpc/redis/index.js +11 -11
- package/dist/rpc/redis/index.mjs +2 -2
- package/dist/server/elysia/index.d.ts +1 -1
- package/dist/server/elysia/index.js +20 -20
- package/dist/server/elysia/index.mjs +3 -3
- package/dist/server/express/index.d.ts +1 -1
- package/dist/server/express/index.js +18 -18
- package/dist/server/express/index.mjs +2 -2
- package/dist/server/fastify/index.d.ts +1 -1
- package/dist/server/fastify/index.js +19 -19
- package/dist/server/fastify/index.mjs +3 -3
- package/dist/server/h3/index.d.ts +1 -1
- package/dist/server/h3/index.js +16 -16
- package/dist/server/h3/index.mjs +2 -2
- package/dist/server/hono/index.d.ts +1 -1
- package/dist/server/hono/index.js +17 -17
- package/dist/server/hono/index.mjs +2 -2
- package/dist/server/hyper-express/index.d.ts +1 -1
- package/dist/server/hyper-express/index.js +17 -17
- package/dist/server/hyper-express/index.mjs +2 -2
- package/dist/server/koa/index.d.ts +1 -1
- package/dist/server/koa/index.js +18 -18
- package/dist/server/koa/index.mjs +2 -2
- package/dist/test.d.ts +1 -1
- package/dist/test.js +8 -8
- package/dist/test.mjs +2 -2
- package/dist/{types-68f2ec2a.d.ts → types-0a76c4bc.d.ts} +9 -0
- package/package.json +1 -1
- package/register/loader.mjs +1 -1
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkH6NYBVBVjs = require('../../chunk-H6NYBVBV.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkFNJWO324js = require('../../chunk-FNJWO324.js');
|
|
11
11
|
|
|
12
12
|
// src/server/hyper-express/bind.ts
|
|
13
13
|
var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
@@ -15,14 +15,14 @@ var debug = _debug2.default.call(void 0, "phecda-server/hyper-express");
|
|
|
15
15
|
function bind(router, data, opts = {}) {
|
|
16
16
|
const { globalGuards, globalInterceptors, parallelRoute = "/__PHECDA_SERVER__", globalPlugins = [], parallelPlugins = [], globalFilter, globalPipe } = opts;
|
|
17
17
|
const { moduleMap, meta } = data;
|
|
18
|
-
const metaMap =
|
|
18
|
+
const metaMap = _chunkH6NYBVBVjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
19
19
|
const { controller, http, func, tag } = meta2.data;
|
|
20
20
|
if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.type])) {
|
|
21
21
|
debug(`register method "${func}" in module "${tag}"`);
|
|
22
22
|
return true;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
-
|
|
25
|
+
_chunkH6NYBVBVjs.detectAopDep.call(void 0, meta, {
|
|
26
26
|
plugins: [
|
|
27
27
|
...globalPlugins,
|
|
28
28
|
...parallelPlugins
|
|
@@ -32,29 +32,29 @@ function bind(router, data, opts = {}) {
|
|
|
32
32
|
});
|
|
33
33
|
registerRoute();
|
|
34
34
|
async function registerRoute() {
|
|
35
|
-
|
|
35
|
+
_chunkH6NYBVBVjs.Context.usePlugin(globalPlugins, "hyper-express").forEach((p) => router.use(p));
|
|
36
36
|
if (parallelRoute) {
|
|
37
37
|
router.post(parallelRoute, {
|
|
38
|
-
middlewares:
|
|
38
|
+
middlewares: _chunkH6NYBVBVjs.Context.usePlugin(parallelPlugins, "hyper-express")
|
|
39
39
|
}, async (req, res, next) => {
|
|
40
40
|
const body = await req.json();
|
|
41
41
|
async function errorHandler(e) {
|
|
42
|
-
const error = await
|
|
42
|
+
const error = await _chunkH6NYBVBVjs.Context.filterRecord.default(e);
|
|
43
43
|
return res.status(error.status).json(error);
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
_chunkFNJWO324js.__name.call(void 0, errorHandler, "errorHandler");
|
|
46
46
|
if (!Array.isArray(body))
|
|
47
|
-
return errorHandler(new (0,
|
|
47
|
+
return errorHandler(new (0, _chunkH6NYBVBVjs.BadRequestException)("data format should be an array"));
|
|
48
48
|
try {
|
|
49
49
|
return Promise.all(body.map((item, i) => {
|
|
50
50
|
return new Promise(async (resolve) => {
|
|
51
51
|
const { tag, func } = item;
|
|
52
52
|
debug(`(parallel)invoke method "${func}" in module "${tag}"`);
|
|
53
53
|
if (!metaMap.has(tag))
|
|
54
|
-
return resolve(await
|
|
54
|
+
return resolve(await _chunkH6NYBVBVjs.Context.filterRecord.default(new (0, _chunkH6NYBVBVjs.BadRequestException)(`module "${tag}" doesn't exist`)));
|
|
55
55
|
const meta2 = metaMap.get(tag)[func];
|
|
56
56
|
if (!meta2)
|
|
57
|
-
return resolve(await
|
|
57
|
+
return resolve(await _chunkH6NYBVBVjs.Context.filterRecord.default(new (0, _chunkH6NYBVBVjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
|
|
58
58
|
const { data: { params } } = meta2;
|
|
59
59
|
const contextData = {
|
|
60
60
|
type: "hyper-express",
|
|
@@ -68,9 +68,9 @@ function bind(router, data, opts = {}) {
|
|
|
68
68
|
func,
|
|
69
69
|
next,
|
|
70
70
|
app: router,
|
|
71
|
-
...
|
|
71
|
+
..._chunkH6NYBVBVjs.argToReq.call(void 0, params, item.args, req.headers)
|
|
72
72
|
};
|
|
73
|
-
const context = new (0,
|
|
73
|
+
const context = new (0, _chunkH6NYBVBVjs.Context)(contextData);
|
|
74
74
|
context.run({
|
|
75
75
|
globalGuards,
|
|
76
76
|
globalInterceptors,
|
|
@@ -93,7 +93,7 @@ function bind(router, data, opts = {}) {
|
|
|
93
93
|
if (!_optionalChain([http, 'optionalAccess', _2 => _2.type]))
|
|
94
94
|
continue;
|
|
95
95
|
const needBody = params.some((item) => item.type === "body");
|
|
96
|
-
router[http.type](http.prefix + http.route, ...
|
|
96
|
+
router[http.type](http.prefix + http.route, ..._chunkH6NYBVBVjs.Context.usePlugin(plugins, "hyper-express"), async (req, res, next) => {
|
|
97
97
|
debug(`invoke method "${func}" in module "${tag}"`);
|
|
98
98
|
const contextData = {
|
|
99
99
|
type: "hyper-express",
|
|
@@ -110,7 +110,7 @@ function bind(router, data, opts = {}) {
|
|
|
110
110
|
headers: req.headers,
|
|
111
111
|
next
|
|
112
112
|
};
|
|
113
|
-
const context = new (0,
|
|
113
|
+
const context = new (0, _chunkH6NYBVBVjs.Context)(contextData);
|
|
114
114
|
if (http.headers) {
|
|
115
115
|
for (const name in http.headers)
|
|
116
116
|
res.set(name, http.headers[name]);
|
|
@@ -136,9 +136,9 @@ function bind(router, data, opts = {}) {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
_chunkFNJWO324js.__name.call(void 0, registerRoute, "registerRoute");
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
_chunkFNJWO324js.__name.call(void 0, bind, "bind");
|
|
142
142
|
|
|
143
143
|
|
|
144
144
|
exports.bind = bind;
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
argToReq,
|
|
5
5
|
createControllerMetaMap,
|
|
6
6
|
detectAopDep
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-Q4AGVGVA.mjs";
|
|
8
8
|
import {
|
|
9
9
|
__name
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-VYDBNZJ2.mjs";
|
|
11
11
|
|
|
12
12
|
// src/server/hyper-express/bind.ts
|
|
13
13
|
import Debug from "debug";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Router, { RouterParamContext } from '@koa/router';
|
|
2
2
|
import { DefaultContext, DefaultState } from 'koa';
|
|
3
|
-
import { a as HttpContext, H as HttpOptions } from '../../types-
|
|
3
|
+
import { a as HttpContext, H as HttpOptions } from '../../types-0a76c4bc.js';
|
|
4
4
|
import { F as Factory } from '../../core-7f6d2be6.js';
|
|
5
5
|
import 'node:http';
|
|
6
6
|
import '../../types-81be0ba3.js';
|
package/dist/server/koa/index.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkH6NYBVBVjs = require('../../chunk-H6NYBVBV.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkFNJWO324js = require('../../chunk-FNJWO324.js');
|
|
12
12
|
|
|
13
13
|
// src/server/koa/bind.ts
|
|
14
14
|
var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
@@ -17,14 +17,14 @@ function bind(router, data, opts = {}) {
|
|
|
17
17
|
const { globalGuards, globalInterceptors, parallelRoute = "/__PHECDA_SERVER__", globalPlugins = [], parallelPlugins = [], globalFilter, globalPipe } = opts;
|
|
18
18
|
const { moduleMap, meta } = data;
|
|
19
19
|
const originStack = router.stack.slice(0, router.stack.length);
|
|
20
|
-
const metaMap =
|
|
20
|
+
const metaMap = _chunkH6NYBVBVjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
21
21
|
const { controller, http, func, tag } = meta2.data;
|
|
22
22
|
if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.type])) {
|
|
23
23
|
debug(`register method "${func}" in module "${tag}"`);
|
|
24
24
|
return true;
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
|
|
27
|
+
_chunkH6NYBVBVjs.detectAopDep.call(void 0, meta, {
|
|
28
28
|
plugins: [
|
|
29
29
|
...globalPlugins,
|
|
30
30
|
...parallelPlugins
|
|
@@ -34,28 +34,28 @@ function bind(router, data, opts = {}) {
|
|
|
34
34
|
});
|
|
35
35
|
registerRoute();
|
|
36
36
|
async function registerRoute() {
|
|
37
|
-
|
|
37
|
+
_chunkH6NYBVBVjs.Context.usePlugin(globalPlugins, "koa").forEach((p) => router.use(p));
|
|
38
38
|
if (parallelRoute) {
|
|
39
|
-
router.post(parallelRoute, ...
|
|
39
|
+
router.post(parallelRoute, ..._chunkH6NYBVBVjs.Context.usePlugin(parallelPlugins, "koa"), async (ctx, next) => {
|
|
40
40
|
const { body } = ctx.request;
|
|
41
41
|
async function errorHandler(e) {
|
|
42
|
-
const error = await
|
|
42
|
+
const error = await _chunkH6NYBVBVjs.Context.filterRecord.default(e);
|
|
43
43
|
ctx.status = error.status;
|
|
44
44
|
ctx.body = error;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
_chunkFNJWO324js.__name.call(void 0, errorHandler, "errorHandler");
|
|
47
47
|
if (!Array.isArray(body))
|
|
48
|
-
return errorHandler(new (0,
|
|
48
|
+
return errorHandler(new (0, _chunkH6NYBVBVjs.BadRequestException)("data format should be an array"));
|
|
49
49
|
try {
|
|
50
50
|
return Promise.all(body.map((item, i) => {
|
|
51
51
|
return new Promise(async (resolve) => {
|
|
52
52
|
const { tag, func } = item;
|
|
53
53
|
debug(`(parallel)invoke method "${func}" in module "${tag}"`);
|
|
54
54
|
if (!metaMap.has(tag))
|
|
55
|
-
return resolve(await
|
|
55
|
+
return resolve(await _chunkH6NYBVBVjs.Context.filterRecord.default(new (0, _chunkH6NYBVBVjs.BadRequestException)(`module "${tag}" doesn't exist`)));
|
|
56
56
|
const meta2 = metaMap.get(tag)[func];
|
|
57
57
|
if (!meta2)
|
|
58
|
-
return resolve(await
|
|
58
|
+
return resolve(await _chunkH6NYBVBVjs.Context.filterRecord.default(new (0, _chunkH6NYBVBVjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
|
|
59
59
|
const { data: { params } } = meta2;
|
|
60
60
|
const contextData = {
|
|
61
61
|
type: "koa",
|
|
@@ -66,11 +66,11 @@ function bind(router, data, opts = {}) {
|
|
|
66
66
|
parallel: true,
|
|
67
67
|
next,
|
|
68
68
|
app: router,
|
|
69
|
-
...
|
|
69
|
+
..._chunkH6NYBVBVjs.argToReq.call(void 0, params, item.args, ctx.headers),
|
|
70
70
|
tag,
|
|
71
71
|
func
|
|
72
72
|
};
|
|
73
|
-
const context = new (0,
|
|
73
|
+
const context = new (0, _chunkH6NYBVBVjs.Context)(contextData);
|
|
74
74
|
context.run({
|
|
75
75
|
globalGuards,
|
|
76
76
|
globalInterceptors,
|
|
@@ -92,7 +92,7 @@ function bind(router, data, opts = {}) {
|
|
|
92
92
|
const { data: { plugins, http } } = meta2;
|
|
93
93
|
if (!_optionalChain([http, 'optionalAccess', _2 => _2.type]))
|
|
94
94
|
continue;
|
|
95
|
-
router[http.type](http.prefix + http.route, ...
|
|
95
|
+
router[http.type](http.prefix + http.route, ..._chunkH6NYBVBVjs.Context.usePlugin(plugins, "koa"), async (ctx, next) => {
|
|
96
96
|
debug(`invoke method "${func}" in module "${tag}"`);
|
|
97
97
|
const contextData = {
|
|
98
98
|
type: "koa",
|
|
@@ -108,7 +108,7 @@ function bind(router, data, opts = {}) {
|
|
|
108
108
|
headers: ctx.headers,
|
|
109
109
|
next
|
|
110
110
|
};
|
|
111
|
-
const context = new (0,
|
|
111
|
+
const context = new (0, _chunkH6NYBVBVjs.Context)(contextData);
|
|
112
112
|
if (http.headers) {
|
|
113
113
|
for (const name in http.headers)
|
|
114
114
|
ctx.set(name, http.headers[name]);
|
|
@@ -132,13 +132,13 @@ function bind(router, data, opts = {}) {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
_chunkFNJWO324js.__name.call(void 0, registerRoute, "registerRoute");
|
|
136
|
+
_chunkH6NYBVBVjs.HMR.call(void 0, async () => {
|
|
137
137
|
router.stack = originStack;
|
|
138
138
|
registerRoute();
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
_chunkFNJWO324js.__name.call(void 0, bind, "bind");
|
|
142
142
|
|
|
143
143
|
|
|
144
144
|
exports.bind = bind;
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
argToReq,
|
|
6
6
|
createControllerMetaMap,
|
|
7
7
|
detectAopDep
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-Q4AGVGVA.mjs";
|
|
9
9
|
import {
|
|
10
10
|
__name
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-VYDBNZJ2.mjs";
|
|
12
12
|
|
|
13
13
|
// src/server/koa/bind.ts
|
|
14
14
|
import Debug from "debug";
|
package/dist/test.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare function TestFactory<T extends Construct[]>(...Modules: T): Promise<{
|
|
|
11
11
|
type SuperTestRequest<T> = {
|
|
12
12
|
[K in keyof T]: T[K] extends (...args: infer R) => any ? (...args: R) => Test : never;
|
|
13
13
|
};
|
|
14
|
-
declare function TestHttp(app: Server | any, { moduleMap, meta }: Awaited<ReturnType<typeof Factory>>, isAgent?: boolean): Promise<supertest.SuperTestWithHost<Test> & Pick<supertest.Request, "
|
|
14
|
+
declare function TestHttp(app: Server | any, { moduleMap, meta }: Awaited<ReturnType<typeof Factory>>, isAgent?: boolean): Promise<supertest.SuperTestWithHost<Test> & Pick<supertest.Request, "use" | "on" | "set" | "query" | "type" | "accept" | "auth" | "withCredentials" | "retry" | "ok" | "redirects" | "timeout" | "buffer" | "serialize" | "parse" | "ca" | "key" | "pfx" | "cert"> & {
|
|
15
15
|
module: <T extends Construct>(Module: T) => SuperTestRequest<PickFunc<InstanceType<T>>>;
|
|
16
16
|
}>;
|
|
17
17
|
|
package/dist/test.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkUJAI73O6js = require('./chunk-UJAI73O6.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkFNJWO324js = require('./chunk-FNJWO324.js');
|
|
7
7
|
|
|
8
8
|
// src/test.ts
|
|
9
9
|
var _phecdacore = require('phecda-core');
|
|
10
10
|
async function TestFactory(...Modules) {
|
|
11
|
-
const { moduleMap, constructorMap } = await
|
|
11
|
+
const { moduleMap, constructorMap } = await _chunkUJAI73O6js.Factory.call(void 0, Modules);
|
|
12
12
|
return {
|
|
13
13
|
get(Module) {
|
|
14
14
|
const tag = _phecdacore.getTag.call(void 0, Module);
|
|
@@ -21,9 +21,9 @@ async function TestFactory(...Modules) {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
_chunkFNJWO324js.__name.call(void 0, TestFactory, "TestFactory");
|
|
25
25
|
async function TestHttp(app, { moduleMap, meta }, isAgent = true) {
|
|
26
|
-
const { default: request, agent } = await Promise.resolve().then(() => require("supertest"));
|
|
26
|
+
const { default: request, agent } = await Promise.resolve().then(() => _interopRequireWildcard(require("supertest")));
|
|
27
27
|
const Agent = agent(app);
|
|
28
28
|
function module(Module) {
|
|
29
29
|
const tag = _phecdacore.getTag.call(void 0, Module);
|
|
@@ -67,11 +67,11 @@ async function TestHttp(app, { moduleMap, meta }, isAgent = true) {
|
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
_chunkFNJWO324js.__name.call(void 0, module, "module");
|
|
71
71
|
Agent.module = module;
|
|
72
72
|
return Agent;
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
_chunkFNJWO324js.__name.call(void 0, TestHttp, "TestHttp");
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
|
package/dist/test.mjs
CHANGED
|
@@ -2,8 +2,17 @@ import { IncomingHttpHeaders } from 'node:http';
|
|
|
2
2
|
import { D as DefaultOptions, B as BaseContext } from './types-81be0ba3.js';
|
|
3
3
|
|
|
4
4
|
interface HttpOptions extends DefaultOptions {
|
|
5
|
+
/**
|
|
6
|
+
* 专用路由的值,默认为/__PHECDA_SERVER__,处理phecda-client发出的合并请求
|
|
7
|
+
*/
|
|
5
8
|
parallelRoute?: string | false;
|
|
9
|
+
/**
|
|
10
|
+
* 专用路由的插件(work for merge request),
|
|
11
|
+
*/
|
|
6
12
|
parallelPlugins?: string[];
|
|
13
|
+
/**
|
|
14
|
+
* only work for http server
|
|
15
|
+
*/
|
|
7
16
|
globalPlugins?: string[];
|
|
8
17
|
}
|
|
9
18
|
interface HttpContext extends BaseContext {
|
package/package.json
CHANGED
package/register/loader.mjs
CHANGED
|
@@ -205,7 +205,7 @@ export const resolve = async (specifier, context, nextResolve) => {
|
|
|
205
205
|
const resolveRet = await nextResolve(specifier)
|
|
206
206
|
|
|
207
207
|
// ts resolve fail in some cases
|
|
208
|
-
if (isAbsolute(resolveRet.url))
|
|
208
|
+
if (resolveRet.url && isAbsolute(resolveRet.url))
|
|
209
209
|
resolveRet.url = pathToFileURL(resolveRet.url).href
|
|
210
210
|
|
|
211
211
|
return resolveRet
|