Skip to main content

Built and signed on GitHub Actions

Utility functions of Advent of Code.

This package works with Node.js, DenoIt is unknown whether this package works with Cloudflare Workers, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
100%
Published
a week ago (0.0.2)
function groupedLines
groupedLines(
input: string,
groupSep?: string | RegExp,
): string[][]

Returns a list of grouped lines.

groupedLines("a\nb\nc\n\nx\ny\nz\n") // [["a", "b", "c"], ["x", "y", "z"]]

Parameters

input: string

The input string which might contain multiple lines.

optional
groupSep: string | RegExp = /\r?\n\r?\n/

Group separator. Characters in the input which mark the separation of different groups of lines.

Return Type

string[][]

Add Package

deno add jsr:@asantos/aoc

Import symbol

import { groupedLines } from "@asantos/aoc/input";

---- OR ----

Import directly with a jsr specifier

import { groupedLines } from "jsr:@asantos/aoc/input";

Add Package

npx jsr add @asantos/aoc

Import symbol

import { groupedLines } from "@asantos/aoc/input";

Add Package

yarn dlx jsr add @asantos/aoc

Import symbol

import { groupedLines } from "@asantos/aoc/input";

Add Package

pnpm dlx jsr add @asantos/aoc

Import symbol

import { groupedLines } from "@asantos/aoc/input";

Add Package

bunx jsr add @asantos/aoc

Import symbol

import { groupedLines } from "@asantos/aoc/input";