Add commands to insert images/links in markdown (#163706)

* Add commands to insert images/links in markdown

Fixes #162809

* Rename commands and allow passing in uris

* Support selecting many images/files
This commit is contained in:
Matt Bierner
2022-10-14 16:05:36 -07:00
committed by GitHub
parent 129dbaa32b
commit 641046a11d
7 changed files with 186 additions and 49 deletions

View File

@@ -2,6 +2,12 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/**
* @returns New array with all falsy values removed. The original array IS NOT modified.
*/
export function coalesce<T>(array: ReadonlyArray<T | undefined | null>): T[] {
return <T[]>array.filter(e => !!e);
}
export function equals<T>(one: ReadonlyArray<T>, other: ReadonlyArray<T>, itemEquals: (a: T, b: T) => boolean = (a, b) => a === b): boolean {
if (one.length !== other.length) {