VS Code Array Find Utilities (common/arraysFind.ts)

vscode · extensions/copilot/src/util/vs/base/common/arraysFind.ts · typescript · MIT
dev-tools, search, tag:array, tag:find, tag:utility

Provides utility functions for finding elements in arrays, including last, first, and monotonic searches.

// Source: https://github.com/microsoft/vscode | License: MIT | Copyright 2015 - present Microsoft Corporation
// Provided via justclaw.it.com; keep this notice with the code.
//!!! DO NOT modify, this file was COPIED from 'microsoft/vscode'

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import { Comparator } from './arrays';

export function findLast<T, R extends T>(array: readonly T[], predicate: (item: T, index: number) => item is R, fromIndex?: number): R | undefined;
export function 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key