import {assert, validURL} from '@muze-nl/assert'
function example(url) {
assert(url, validURL)
return fetch(url)
}
This will call fails()
. If any assertion fails, it will throw an error with all failed assertions. If assert is disabled--the default state--no assertions will be checked. See fails()
for a list of possible assertions.