Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 404 Bytes

assert.md

File metadata and controls

12 lines (9 loc) · 404 Bytes

assert

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.