Skip to main content
Module

x/pazza/mod.ts>slice

Parser combinators library designed for Deno, but also works on browsers and Node.js.
Go to Latest
function slice
import { slice } from "https://deno.land/x/pazza@v0.3.0/mod.ts";

Parse a specified slice of bytes.

const parser = slice(Uint8Array.of(13, 10));
parser(Uint8Array.of(13, 10)).output; // ==> Uint8Array [13, 10]
parser(Uint8Array.of(13, 13)).ok === false;

Parameters

slice: Uint8Array

slice of 8-bit unsigned integers

Returns

IParser<Uint8Array, ErrorKind.Slice, Uint8Array>