@stacksjs/api 0.58.72 → 0.59.1

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.
@@ -0,0 +1,14 @@
1
+ interface Params {
2
+ [key: string]: any;
3
+ }
4
+ export declare function useHttpFetch(endpoint?: string): Promise<{
5
+ post: (url: string, params?: Params) => Promise<any>;
6
+ get: (url: string, params?: Params) => Promise<any>;
7
+ patch: (url: string, params?: Params) => Promise<any>;
8
+ destroy: (url: string, params?: Params) => Promise<any>;
9
+ baseURL: string;
10
+ loading: any;
11
+ token: any;
12
+ setToken: (authToken: string) => void;
13
+ }>;
14
+ export {};
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- // /home/runner/work/stacks/stacks/node_modules/destr/dist/index.mjs
2
+ // ../../../../node_modules/destr/dist/index.mjs
3
3
  var jsonParseTransform = function(key, value) {
4
4
  if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
5
5
  warnKeyDropped(key);
@@ -15,7 +15,7 @@ var destr = function(value, options = {}) {
15
15
  return value;
16
16
  }
17
17
  const _value = value.trim();
18
- if (value[0] === '"' && value.at(-1) === '"' && !value.includes("\\")) {
18
+ if (value[0] === '"' && value.endsWith('"') && !value.includes("\\")) {
19
19
  return _value.slice(1, -1);
20
20
  }
21
21
  if (_value.length <= 9) {
@@ -67,7 +67,7 @@ var suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\
67
67
  var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
68
68
  var JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
69
69
 
70
- // /home/runner/work/stacks/stacks/node_modules/ufo/dist/index.mjs
70
+ // ../../../../node_modules/ufo/dist/index.mjs
71
71
  var encode = function(text) {
72
72
  return encodeURI("" + text).replace(ENC_PIPE_RE, "|");
73
73
  };
@@ -280,7 +280,7 @@ var TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
280
280
  var JOIN_LEADING_SLASH_RE = /^\.?\//;
281
281
  var protocolRelative = Symbol.for("ufo:protocolRelative");
282
282
 
283
- // /home/runner/work/stacks/stacks/node_modules/ofetch/dist/shared/ofetch.00501375.mjs
283
+ // ../../../../node_modules/ofetch/dist/shared/ofetch.00501375.mjs
284
284
  var createFetchError = function(ctx) {
285
285
  const errorMessage = ctx.error?.message || ctx.error?.toString() || "";
286
286
  const method = ctx.request?.method || ctx.options?.method || "GET";
@@ -532,7 +532,7 @@ var retryStatusCodes = new Set([
532
532
  ]);
533
533
  var nullBodyResponses = new Set([101, 204, 205, 304]);
534
534
 
535
- // /home/runner/work/stacks/stacks/node_modules/ofetch/dist/index.mjs
535
+ // ../../../../node_modules/ofetch/dist/index.mjs
536
536
  var _globalThis = function() {
537
537
  if (typeof globalThis !== "undefined") {
538
538
  return globalThis;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/api",
3
3
  "type": "module",
4
- "version": "0.58.72",
4
+ "version": "0.59.1",
5
5
  "description": "The Stacks array utilities.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",