@unocss/language-server 66.6.6 → 66.6.8
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/{chunk-C9ebiww4.mjs → chunk-CBBoxR_p.mjs} +8 -14
- package/dist/{dist-Dwf-d4OE.mjs → dist-DJp734Em.mjs} +2 -4
- package/dist/{dist-BUrt6dYo.cjs → dist-FL7p7uq2.cjs} +17 -20
- package/dist/index.d.mts +8 -3
- package/dist/index.mjs +683 -719
- package/dist/jiti-du6HSta6.cjs +4474 -0
- package/dist/{loader-CxlILAbz.mjs → loader-DsXvVy9i.mjs} +4 -19
- package/dist/{multipart-parser-s9tbX9e1.cjs → multipart-parser-DiNB_U8f.cjs} +13 -15
- package/dist/{multipart-parser-D3zGHRx2.mjs → multipart-parser-KkZpcbcp.mjs} +3 -5
- package/dist/{node-B8nS8lcG.cjs → node-3wiZdXIz.cjs} +40 -42
- package/dist/{node-CautW6cw.cjs → node-BM09n__k.cjs} +969 -967
- package/dist/{node-rKyHxxpg.mjs → node-Cd2HRubI.mjs} +930 -928
- package/dist/{node-DvibxqDE.mjs → node-D23LglTq.mjs} +32 -34
- package/dist/{node-loader-BO0uvH6Z.cjs → node-loader-BJV6yUBJ.cjs} +676 -689
- package/dist/{node-loader-DpZIWCu9.mjs → node-loader-ZSa5xzQw.mjs} +440 -453
- package/dist/{prompt-BJqhZQ-_.cjs → prompt-jldWOuck.cjs} +265 -267
- package/dist/server.cjs +14417 -14572
- package/package.json +39 -6
- package/dist/jiti-B459FbZV.cjs +0 -4477
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { n as withBase, r as withQuery } from "./dist-
|
|
2
|
-
import {
|
|
1
|
+
import { n as withBase, r as withQuery } from "./dist-DJp734Em.mjs";
|
|
2
|
+
import { c as ye, n as Mn, t as Mi } from "./node-Cd2HRubI.mjs";
|
|
3
3
|
import http from "node:http";
|
|
4
4
|
import https from "node:https";
|
|
5
|
-
|
|
6
5
|
//#region ../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs
|
|
7
|
-
const o = !!globalThis.process?.env?.FORCE_NODE_FETCH, r = !o && globalThis.fetch || Mi
|
|
8
|
-
|
|
6
|
+
const o = !!globalThis.process?.env?.FORCE_NODE_FETCH, r = !o && globalThis.fetch || Mi;
|
|
7
|
+
!o && globalThis.Blob;
|
|
8
|
+
!o && globalThis.File;
|
|
9
|
+
!o && globalThis.FormData;
|
|
10
|
+
const n = !o && globalThis.Headers || ye;
|
|
11
|
+
!o && globalThis.Request;
|
|
12
|
+
!o && globalThis.Response;
|
|
13
|
+
const T = !o && globalThis.AbortController || Mn;
|
|
9
14
|
//#endregion
|
|
10
15
|
//#region ../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs
|
|
11
16
|
const suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
|
|
@@ -49,7 +54,6 @@ function destr(value, options = {}) {
|
|
|
49
54
|
return value;
|
|
50
55
|
}
|
|
51
56
|
}
|
|
52
|
-
|
|
53
57
|
//#endregion
|
|
54
58
|
//#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs
|
|
55
59
|
var FetchError = class extends Error {
|
|
@@ -116,8 +120,8 @@ function detectResponseType(_contentType = "") {
|
|
|
116
120
|
if (textTypes.has(contentType) || contentType.startsWith("text/")) return "text";
|
|
117
121
|
return "blob";
|
|
118
122
|
}
|
|
119
|
-
function resolveFetchOptions(request, input, defaults, Headers
|
|
120
|
-
const headers = mergeHeaders(input?.headers ?? request?.headers, defaults?.headers, Headers
|
|
123
|
+
function resolveFetchOptions(request, input, defaults, Headers) {
|
|
124
|
+
const headers = mergeHeaders(input?.headers ?? request?.headers, defaults?.headers, Headers);
|
|
121
125
|
let query;
|
|
122
126
|
if (defaults?.query || defaults?.params || input?.params || input?.query) query = {
|
|
123
127
|
...defaults?.params,
|
|
@@ -133,10 +137,10 @@ function resolveFetchOptions(request, input, defaults, Headers$1) {
|
|
|
133
137
|
headers
|
|
134
138
|
};
|
|
135
139
|
}
|
|
136
|
-
function mergeHeaders(input, defaults, Headers
|
|
137
|
-
if (!defaults) return new Headers
|
|
138
|
-
const headers = new Headers
|
|
139
|
-
if (input) for (const [key, value] of Symbol.iterator in input || Array.isArray(input) ? input : new Headers
|
|
140
|
+
function mergeHeaders(input, defaults, Headers) {
|
|
141
|
+
if (!defaults) return new Headers(input);
|
|
142
|
+
const headers = new Headers(defaults);
|
|
143
|
+
if (input) for (const [key, value] of Symbol.iterator in input || Array.isArray(input) ? input : new Headers(input)) headers.set(key, value);
|
|
140
144
|
return headers;
|
|
141
145
|
}
|
|
142
146
|
async function callHooks(context, hooks) {
|
|
@@ -160,7 +164,7 @@ const nullBodyResponses = /* @__PURE__ */ new Set([
|
|
|
160
164
|
304
|
|
161
165
|
]);
|
|
162
166
|
function createFetch(globalOptions = {}) {
|
|
163
|
-
const { fetch
|
|
167
|
+
const { fetch = globalThis.fetch, Headers = globalThis.Headers, AbortController = globalThis.AbortController } = globalOptions;
|
|
164
168
|
async function onError(context) {
|
|
165
169
|
const isAbort = context.error && context.error.name === "AbortError" && !context.options.timeout || false;
|
|
166
170
|
if (context.options.retry !== false && !isAbort) {
|
|
@@ -170,7 +174,7 @@ function createFetch(globalOptions = {}) {
|
|
|
170
174
|
const responseCode = context.response && context.response.status || 500;
|
|
171
175
|
if (retries > 0 && (Array.isArray(context.options.retryStatusCodes) ? context.options.retryStatusCodes.includes(responseCode) : retryStatusCodes.has(responseCode))) {
|
|
172
176
|
const retryDelay = typeof context.options.retryDelay === "function" ? context.options.retryDelay(context) : context.options.retryDelay || 0;
|
|
173
|
-
if (retryDelay > 0) await new Promise((resolve
|
|
177
|
+
if (retryDelay > 0) await new Promise((resolve) => setTimeout(resolve, retryDelay));
|
|
174
178
|
return $fetchRaw(context.request, {
|
|
175
179
|
...context.options,
|
|
176
180
|
retry: retries - 1
|
|
@@ -184,14 +188,14 @@ function createFetch(globalOptions = {}) {
|
|
|
184
188
|
const $fetchRaw = async function $fetchRaw2(_request, _options = {}) {
|
|
185
189
|
const context = {
|
|
186
190
|
request: _request,
|
|
187
|
-
options: resolveFetchOptions(_request, _options, globalOptions.defaults, Headers
|
|
191
|
+
options: resolveFetchOptions(_request, _options, globalOptions.defaults, Headers),
|
|
188
192
|
response: void 0,
|
|
189
193
|
error: void 0
|
|
190
194
|
};
|
|
191
195
|
if (context.options.method) context.options.method = context.options.method.toUpperCase();
|
|
192
196
|
if (context.options.onRequest) {
|
|
193
197
|
await callHooks(context, context.options.onRequest);
|
|
194
|
-
if (!(context.options.headers instanceof Headers
|
|
198
|
+
if (!(context.options.headers instanceof Headers)) context.options.headers = new Headers(context.options.headers || {});
|
|
195
199
|
}
|
|
196
200
|
if (typeof context.request === "string") {
|
|
197
201
|
if (context.options.baseURL) context.request = withBase(context.request, context.options.baseURL);
|
|
@@ -214,7 +218,7 @@ function createFetch(globalOptions = {}) {
|
|
|
214
218
|
}
|
|
215
219
|
let abortTimeout;
|
|
216
220
|
if (!context.options.signal && context.options.timeout) {
|
|
217
|
-
const controller = new AbortController
|
|
221
|
+
const controller = new AbortController();
|
|
218
222
|
abortTimeout = setTimeout(() => {
|
|
219
223
|
const error = /* @__PURE__ */ new Error("[TimeoutError]: The operation was aborted due to timeout");
|
|
220
224
|
error.name = "TimeoutError";
|
|
@@ -224,7 +228,7 @@ function createFetch(globalOptions = {}) {
|
|
|
224
228
|
context.options.signal = controller.signal;
|
|
225
229
|
}
|
|
226
230
|
try {
|
|
227
|
-
context.response = await fetch
|
|
231
|
+
context.response = await fetch(context.request, context.options);
|
|
228
232
|
} catch (error) {
|
|
229
233
|
context.error = error;
|
|
230
234
|
if (context.options.onRequestError) await callHooks(context, context.options.onRequestError);
|
|
@@ -254,12 +258,12 @@ function createFetch(globalOptions = {}) {
|
|
|
254
258
|
}
|
|
255
259
|
return context.response;
|
|
256
260
|
};
|
|
257
|
-
const $fetch
|
|
261
|
+
const $fetch = async function $fetch2(request, options) {
|
|
258
262
|
return (await $fetchRaw(request, options))._data;
|
|
259
263
|
};
|
|
260
|
-
$fetch
|
|
261
|
-
$fetch
|
|
262
|
-
$fetch
|
|
264
|
+
$fetch.raw = $fetchRaw;
|
|
265
|
+
$fetch.native = (...args) => fetch(...args);
|
|
266
|
+
$fetch.create = (defaultOptions = {}, customGlobalOptions = {}) => createFetch({
|
|
263
267
|
...globalOptions,
|
|
264
268
|
...customGlobalOptions,
|
|
265
269
|
defaults: {
|
|
@@ -268,9 +272,8 @@ function createFetch(globalOptions = {}) {
|
|
|
268
272
|
...defaultOptions
|
|
269
273
|
}
|
|
270
274
|
});
|
|
271
|
-
return $fetch
|
|
275
|
+
return $fetch;
|
|
272
276
|
}
|
|
273
|
-
|
|
274
277
|
//#endregion
|
|
275
278
|
//#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs
|
|
276
279
|
function createNodeFetch() {
|
|
@@ -288,15 +291,10 @@ function createNodeFetch() {
|
|
|
288
291
|
});
|
|
289
292
|
};
|
|
290
293
|
}
|
|
291
|
-
const fetch =
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
fetch,
|
|
296
|
-
Headers,
|
|
297
|
-
AbortController
|
|
294
|
+
const $fetch = createFetch({
|
|
295
|
+
fetch: globalThis.fetch ? (...args) => globalThis.fetch(...args) : createNodeFetch(),
|
|
296
|
+
Headers: globalThis.Headers || n,
|
|
297
|
+
AbortController: globalThis.AbortController || T
|
|
298
298
|
});
|
|
299
|
-
const $fetch = ofetch;
|
|
300
|
-
|
|
301
299
|
//#endregion
|
|
302
|
-
export { $fetch };
|
|
300
|
+
export { $fetch };
|