UNPKG

@graphprotocol/toolshed

Version:

A collection of tools and utilities for the Graph Protocol Typescript components

9 lines (7 loc) 291 B
import { AssertionError } from 'assert' export function assertObject(value: unknown, errorMessage?: string): asserts value is Record<string, unknown> { if (typeof value !== 'object' || value == null) throw new AssertionError({ message: errorMessage ?? 'Not an object', }) }