@literate.ink/utilities
Advanced tools
Comparing version 1.0.0-10479345192.1 to 1.0.0-10641118381.1
@@ -1,2 +0,2 @@ | ||
declare const findValueBetween: (plain: string, start: string, end: string) => string; | ||
declare const findValueBetween: (plain: string, start: string, end: string) => string | null; | ||
/** | ||
@@ -3,0 +3,0 @@ * Special typing for React Native. |
@@ -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)=>{const r=e.indexOf(t)+t.length,o=e.indexOf(s,r);return 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});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-10479345192.1", | ||
"version": "1.0.0-10641118381.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
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
19921