@literate.ink/utilities
Advanced tools
Comparing version 1.0.0-10251128934.1 to 1.0.0-10253778099.1
@@ -14,7 +14,7 @@ interface HeadersLike { | ||
interface Request { | ||
url: string; | ||
url: URL; | ||
/** | ||
* @default "GET" | ||
*/ | ||
method?: string; | ||
method?: "GET" | "POST"; | ||
/** | ||
@@ -25,3 +25,6 @@ * Body of the request. | ||
content?: string; | ||
/** Headers that should be appended to the request. */ | ||
/** | ||
* Headers that should be appended to the request. | ||
* @default {} | ||
*/ | ||
headers?: Record<string, string> | Headers; | ||
@@ -28,0 +31,0 @@ /** |
@@ -1,1 +0,1 @@ | ||
"use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,a={};((e,r)=>{for(var o in r)t(e,o,{get:r[o],enumerable:!0})})(a,{defaultFetcher:()=>p,getCookiesFromResponse:()=>c,getHeaderFromResponse:()=>d,setHeaderToRequest:()=>i}),module.exports=(e=a,((e,a,n,c)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let d of o(a))s.call(e,d)||d===n||t(e,d,{get:()=>a[d],enumerable:!(c=r(a,d))||c.enumerable});return e})(t({},"__esModule",{value:!0}),e));var n=require("set-cookie-parser"),c=e=>{const t=d(e,"set-cookie");return null===t?[]:(0,n.splitCookiesString)(t).map((e=>e.split(";")[0]))},d=(e,t)=>{const r=e.headers;return u(r)?r.get(t):r[t]},u=e=>"function"==typeof e.get,i=(e,t,r)=>{e.headers||(e.headers={}),u(e.headers)?e.headers.set(t,r):e.headers[t]=r},p=async e=>{const t=await fetch(e.url,{redirect:e.redirect,headers:e.headers,method:e.method,body:e.content});return{status:t.status,content:await t.text(),headers:t.headers}};//# sourceMappingURL=index.js.map | ||
"use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,a={};((e,r)=>{for(var o in r)t(e,o,{get:r[o],enumerable:!0})})(a,{defaultFetcher:()=>l,getCookiesFromResponse:()=>c,getHeaderFromResponse:()=>d,setHeaderToRequest:()=>i}),module.exports=(e=a,((e,a,n,c)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let d of o(a))s.call(e,d)||d===n||t(e,d,{get:()=>a[d],enumerable:!(c=r(a,d))||c.enumerable});return e})(t({},"__esModule",{value:!0}),e));var n=require("set-cookie-parser"),c=e=>{const t=d(e,"set-cookie");return null===t?[]:(0,n.splitCookiesString)(t).map((e=>e.split(";")[0]))},d=(e,t)=>{const r=e.headers;return u(r)?r.get(t):r[t]},u=e=>"function"==typeof e.get,i=(e,t,r)=>{e.headers||(e.headers={}),u(e.headers)?e.headers.set(t,r):e.headers[t]=r},l=async e=>{const t=await fetch(e.url.href,{redirect:e.redirect??"follow",headers:e.headers??{},method:e.method??"GET",body:e.content});return{status:t.status,content:await t.text(),headers:t.headers}};//# sourceMappingURL=index.js.map |
{ | ||
"name": "@literate.ink/utilities", | ||
"version": "1.0.0-10251128934.1", | ||
"version": "1.0.0-10253778099.1", | ||
"description": "A general package containing utilities for helping building our libraries.", | ||
@@ -5,0 +5,0 @@ "private": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13813
48