microsoft/typespec

Public

mirrored from https://github.com/microsoft/typespecAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
copilot/add-vanity-link-sdk-folder

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

packages/html-program-viewer/src/utils.ts

11lines · modecode

1import type { Type, Union } from "@typespec/compiler";
2
3export type NamedType = Type & { name: string };
4
5export function isNamedUnion(union: Union): union is Union & { name: string } {
6 return union.name !== undefined;
7}
8
9export function isMapLike(value: any): value is Map<string, any> {
10 return "entries" in value && typeof value.entries === "function";
11}
12