Skip to content

Make nonempty array generic type, use to describe ResourceLoader.getEnvironments() #1962

@jlrobins

Description

@jlrobins

Make a type NonEmptyArray<T> = [T, ...T[]]; somewhere useful.

Use it to annotate the return type for ResourceLoader.getEnvironments()

Then remove any checks over return results for ResourceLoader.getEnvironments() having returned empty array, such as in GetEnvironmentsTool() check over if (!environments.length).

(CCloud accounts will always have at least one (possibly no resources) Environment).

Metadata

Metadata

Assignees

Labels

cleanupGeneral refactoring and/or minor adjustments needed that shouldn't impact overall functionality

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions