function Name
Name<
T,
U,
>
(
name: string,
named: T,
props?: U,
):
T
& U
& Name

Set the name of something. Optionally, assign metadata.

  • By default, the name property of functions is read-only, so this is accomplished using [Object.defineProperty].

  • Metadata added by this function is coped by descriptor, which means getters and setters will work as defined.

Type Parameters

Parameters

name: string
named: T
optional
props: U

Return Type

T
& U
& Name
type alias Name

Something that may have a name.

Properties

name: string

Usage

import { Name } from ".";