import { matchAfterPrefix } from "https://dotland.deno.dev/std@0.119.0/mime/mod.ts";
Checks whether buf
should be considered to match the boundary.
The prefix is "--boundary" or "\r\n--boundary" or "\n--boundary", and the
caller has verified already that hasPrefix(buf, prefix)
is true.
matchAfterPrefix()
returns 1
if the buffer does match the boundary,
meaning the prefix is followed by a dash, space, tab, cr, nl, or EOF.
It returns -1
if the buffer definitely does NOT match the boundary,
meaning the prefix is followed by some other character.
For example, "--foobar" does not match "--foo".
It returns 0
more input needs to be read to make the decision,
meaning that buf.length
and prefix.length
are the same.