tag
tag: <
Tag>(tag) =>tag<Tag>
Defined in: node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/dts/Schema.d.ts:1369
Returns a property signature that represents a tag.
A tag is a literal value that is used to distinguish between different types of objects.
The tag is optional when using the make method.
Type Parameters
Section titled “Type Parameters”Tag extends LiteralValue
Parameters
Section titled “Parameters”Tag
Returns
Section titled “Returns”tag<Tag>
Example
Section titled “Example”import * as assert from "node:assert"import { Schema } from "effect"
const User = Schema.Struct({ _tag: Schema.tag("User"), name: Schema.String, age: Schema.Number})
assert.deepStrictEqual(User.make({ name: "John", age: 44 }), { _tag: "User", name: "John", age: 44 })3.10.0