UNPKG

succulent

Version:

Powerful and easy runtime type checking

14 lines 590 B
import { Schema } from "../schema"; import { toDisplayKey } from "./toDisplayKey"; import { toDisplayString } from "./toDisplayString"; export function invalidProperty(key, schema) { const displayKey = toDisplayKey(key); const typeName = Schema.displayName(schema); return `Expected property ${displayKey} to have type ${typeName}`; } export function invalidValue(value, schema) { const displayValue = toDisplayString(value); const typeName = Schema.displayName(schema); return `Expected ${typeName}, got ${displayValue}`; } //# sourceMappingURL=errorMessages.js.map