Skip to main content
Module

x/args/utils.ts>partition

Extensible CLI arguments parser for Deno with intelligent TypeScript inference
Go to Latest
function partition
import { partition } from "https://deno.land/x/args@2.1.0/utils.ts";

Divide a list into two, one where fn returns true, other where fn returns false

Type Parameters

X0

Type of item

X1 extends X0

Type of item where fn returns true

Parameters

xs: Iterable<X0>

List

fn: (x: X0) => x is X1

Predicate

Returns

[X1[], X0[]]

A tuple of two sub-lists