Prism · Objects
$type
Names what kind of value something is: string, number, boolean, null, array or object.
{
text: 'hello',
count: 3,
on: true,
nothing: null,
list: [1, 2],
record: { a: 1 },
}{
text: { $type: { $ref: '$.text' } },
count: { $type: { $ref: '$.count' } },
on: { $type: { $ref: '$.on' } },
nothing: { $type: { $ref: '$.nothing' } },
list: { $type: { $ref: '$.list' } },
record: { $type: { $ref: '$.record' } },
}{
text: 'string',
count: 'number',
on: 'boolean',
nothing: 'null',
list: 'array',
record: 'object',
}Runs in this page on the installed package. The input and the expected output are defined by the example.