UNPKG

@conform-to/dom

Version:

A set of opinionated helpers built on top of the Constraint Validation API

14 lines (12 loc) 301 B
function invariant(expectedCondition, message) { if (!expectedCondition) { throw new Error(message); } } function generateId() { return (Date.now() * Math.random()).toString(36); } function clone(data) { return JSON.parse(JSON.stringify(data)); } export { clone, generateId, invariant };