Debian Codegraph @

benchmarks/webidl/webidl-is.mjs

raw symbols SCIP
1 import { bench, run, barplot } from 'mitata'
2 import { Headers, FormData } from '../../index.js'
3 import { webidl } from '../../lib/web/webidl/index.js'
4
5 const headers = new Headers()
6 const fd = new FormData()
7
8 barplot(() => {
9 bench('webidl.is.FormData (ok)', () => {
10 return webidl.is.FormData(fd)
11 })
12
13 bench('webidl.is.FormData (bad)', () => {
14 return !webidl.is.FormData(headers)
15 })
16
17 bench('instanceof (ok)', () => {
18 return fd instanceof FormData
19 })
20
21 bench('instanceof (bad)', () => {
22 return !(headers instanceof FormData)
23 })
24 })
25
26 await run()