@literate.ink/utilities
Advanced tools
Comparing version 1.0.0-10641118381.1 to 1.0.0-11713907881.1
@@ -1,1 +0,1 @@ | ||
"use strict";var e=require("set-cookie-parser"),t=(e,t)=>{const r=e.headers;return s(r)?r.get(t):r[t]},s=e=>"function"==typeof e.get,r=(e,t)=>{o(e,"Cookie",t.join("; "))},o=(e,t,r)=>{e.headers||={},s(e.headers)?e.headers.set(t,r):e.headers[t]=r};exports.defaultFetcher=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}},exports.findValueBetween=(e,t,s)=>{let r=e.indexOf(t);if(-1===r)return null;r+=t.length;const o=e.indexOf(s,r);return-1===o?null:e.slice(r,o)},exports.getCookiesFromResponse=s=>{const r=t(s,"set-cookie");return null===r?[]:e.splitCookiesString(r).map((e=>e.split(";")[0]))},exports.getHeaderFromResponse=t,exports.setCookiesArrayToRequest=r,exports.setCookiesObjectToRequest=(e,t)=>{const s=Object.entries(t).map((([e,t])=>`${e}=${t}`));r(e,s)},exports.setHeaderToRequest=o;//# sourceMappingURL=index.js.map | ||
"use strict";var e=require("set-cookie-parser"),t=(e,t)=>{const r=e.headers;return s(r)?r.get(t):r[t]},s=e=>"function"==typeof e.get,r=(e,t)=>{o(e,"Cookie",t.join("; "))},o=(e,t,r)=>{e.headers||={},s(e.headers)?e.headers.set(t,r):e.headers[t]=r};exports.defaultFetcher=async e=>{const t=await fetch(e.url.href,{redirect:e.redirect??"follow",headers:e.headers??{},method:e.method??"GET",body:e.content,credentials:"omit"});return{status:t.status,content:await t.text(),headers:t.headers}},exports.findValueBetween=(e,t,s)=>{let r=e.indexOf(t);if(-1===r)return null;r+=t.length;const o=e.indexOf(s,r);return-1===o?null:e.slice(r,o)},exports.getCookiesFromResponse=s=>{const r=t(s,"set-cookie");return null===r?[]:e.splitCookiesString(r).map((e=>e.split(";")[0]))},exports.getHeaderFromResponse=t,exports.setCookiesArrayToRequest=r,exports.setCookiesObjectToRequest=(e,t)=>{const s=Object.entries(t).map((([e,t])=>`${e}=${t}`));r(e,s)},exports.setHeaderToRequest=o;//# sourceMappingURL=index.js.map |
{ | ||
"name": "@literate.ink/utilities", | ||
"version": "1.0.0-10641118381.1", | ||
"version": "1.0.0-11713907881.1", | ||
"description": "A general package containing utilities for helping building our libraries.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/LiterateInk/Utilities", |
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
20219
202