Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/list/custom/implementation/leaf/non-empty.ts>ListNonEmptyBase

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
class ListNonEmptyBase
implements [List.NonEmpty]<T>
extends NonEmptyBase<T>
Abstract
import { ListNonEmptyBase } from "https://deno.land/x/rimbu@0.13.1/list/custom/implementation/leaf/non-empty.ts";

Properties

abstract
readonly
context: ListContext
readonly
isEmpty: false
abstract
readonly
length: number

Methods

abstract
append(value: T): List.NonEmpty<T>
asNormal(): this
collect<T2>(
collectFun: CollectFun<T, T2>,
range?: IndexRange,
reversed?,
): List<T2>
abstract
concat<T2 = T>(...sources: ArrayNonEmpty<StreamSource<T2>>): List.NonEmpty<T | T2>
abstract
drop(amount: number): List<T>
filter(
pred: (
value: T,
index: number,
halt: () => void,
) => boolean
,
range?: IndexRange,
reversed?,
): List<T>
first(): T
flatMap<T2>(
flatMapFun: (value: T, index: number) => StreamSource<T2>,
range?: IndexRange,
reversed?,
): List<T2> | any
abstract
forEach(f: (
value: T,
index: number,
halt: () => void,
) => void
, traverseState?: TraverseState
): void
abstract
get<O>(index: number, otherwise?: OptLazy<O>): T | O
insert(index: number, values: StreamSource<T>): List<T> | any
last(): T
abstract
map<T2>(mapFun: (value: T, index: number) => T2, reversed?: boolean): List.NonEmpty<T2>
abstract
mapPure<T2>(
mapFun: (value: T) => T2,
reversed?: boolean,
cacheMap?: CacheMap,
): List.NonEmpty<T2>
nonEmpty(): true
padTo(
length: number,
fill: T,
positionPercentage?,
): List.NonEmpty<T>
abstract
prepend(value: T): List.NonEmpty<T>
remove(index: number, amount?): List<T>
repeat(amount: number): List.NonEmpty<T>
abstract
reversed(cache?: CacheMap): List.NonEmpty<T>
rotate(shiftRightAmount: number): List.NonEmpty<T>
slice(range: IndexRange, reversed: boolean): List<T>
splice(unnamed 0?: { index?: number; remove?: number; insert?: StreamSource<T>; }): List<T> | any
abstract
stream(reversed?: boolean): Stream.NonEmpty<T>
abstract
streamRange(range: IndexRange, reversed?: boolean): Stream<T>
abstract
structure(): string
abstract
take(amount: number): List<T> | any
abstract
toArray(range?: IndexRange, reversed?: boolean): T[] | any
toBuilder(): List.Builder<T>
toJSON(): ToJSON<T[], this["context"]["typeTag"]>
toString(): string
abstract
updateAt(index: number, update: Update<T>): List.NonEmpty<T>
[Symbol.iterator](): FastIterator<T>