Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/actionify/src/deps/types.ts>identity

Create and manage your GitHub workflows with TypeScript and Deno.
Latest
function identity
import { identity } from "https://deno.land/x/actionify@0.3.0/src/deps/types.ts";

A generic function that, when given some branded type, can take a value with the base type of the branded type, and cast that value to the branded type. It fulfills the contract of a Brander.

At runtime, this function simply returns the value as-is.

Examples

Example 1

type UserId = Brand<number, 'user'>;
const UserId: Brander<UserId> = identity;

Parameters

underlying: BaseOf<B>

The value with a base type, to be casted

Returns

The same underlying value, but casted