diff --git a/src/index.ts b/src/index.ts index 90fc6b8..13313f6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,11 @@ import { splitCookiesString } from "set-cookie-parser"; +export const findValueBetween = (plain: string, start: string, end: string): string => { + const startIndex = plain.indexOf(start) + start.length; + const endIndex = plain.indexOf(end, startIndex); + return plain.slice(startIndex, endIndex); +}; + interface HeadersLike { get (key: string): string | null };