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

x/ts_morph/common/mod.ts>ArrayUtils

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
class ArrayUtils
import { ArrayUtils } from "https://deno.land/x/ts_morph@16.0.0/common/mod.ts";

Constructors

new
private
ArrayUtils()

Static Methods

binaryInsertWithOverwrite<T>(
items: T[],
newItem: T,
comparer: Comparer<T>,
): void
binarySearch<T>(items: ReadonlyArray<T>, storedComparer: StoredComparer<T>): number
containsSubArray<T>(items: ReadonlyArray<T>, subArray: ReadonlyArray<T>): boolean
flatten<T>(items: T[][]): T[]
from<T>(items: ts.Iterator<T>): T[]
getUniqueItems<T>(a: ReadonlyArray<T>): T[]
groupBy<T>(items: ReadonlyArray<T>, getGroup: (item: T) => string | number): T[][]
isNullOrEmpty<T>(a: ReadonlyArray<T> | undefined): a is undefined
isReadonlyArray<T>(a: unknown): a is ReadonlyArray<T>
removeAll<T>(a: T[], isMatch: (item: T) => boolean): T[]
removeFirst<T>(a: T[], item: T): boolean
sortByProperty<T>(items: T[], getProp: (item: T) => string | number): T[]
toIterator<T>(items: ReadonlyArray<T>): Generator<T, void, unknown>