@unocss/language-server 66.6.6-beta.1 → 66.6.7

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.
@@ -1,11 +1,16 @@
1
- import { n as withBase, r as withQuery } from "./dist-Dwf-d4OE.mjs";
2
- import { a as le, c as ye, i as dt, n as Mn, o as qn, r as br, s as ut, t as Mi } from "./node-rKyHxxpg.mjs";
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, p = !o && globalThis.Blob || ut, F = !o && globalThis.File || qn, h = !o && globalThis.FormData || br, n = !o && globalThis.Headers || ye, c = !o && globalThis.Request || dt, R = !o && globalThis.Response || le, T = !o && globalThis.AbortController || Mn;
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$1) {
120
- const headers = mergeHeaders(input?.headers ?? request?.headers, defaults?.headers, Headers$1);
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$1) {
137
- if (!defaults) return new Headers$1(input);
138
- const headers = new Headers$1(defaults);
139
- if (input) for (const [key, value] of Symbol.iterator in input || Array.isArray(input) ? input : new Headers$1(input)) headers.set(key, value);
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: fetch$1 = globalThis.fetch, Headers: Headers$1 = globalThis.Headers, AbortController: AbortController$1 = globalThis.AbortController } = globalOptions;
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$1) => setTimeout(resolve$1, retryDelay));
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$1),
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$1)) context.options.headers = new Headers$1(context.options.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$1();
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$1(context.request, context.options);
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$1 = async function $fetch2(request, options) {
261
+ const $fetch = async function $fetch2(request, options) {
258
262
  return (await $fetchRaw(request, options))._data;
259
263
  };
260
- $fetch$1.raw = $fetchRaw;
261
- $fetch$1.native = (...args) => fetch$1(...args);
262
- $fetch$1.create = (defaultOptions = {}, customGlobalOptions = {}) => createFetch({
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$1;
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 = globalThis.fetch ? (...args) => globalThis.fetch(...args) : createNodeFetch();
292
- const Headers = globalThis.Headers || n;
293
- const AbortController = globalThis.AbortController || T;
294
- const ofetch = createFetch({
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 };