MCPcopy
hub / github.com/heroku/react-refetch / typecheck

Function typecheck

src/utils/checkTypes.js:4–12  ·  view source on GitHub ↗
(types, name, obj)

Source from the content-addressed store, hash-verified

2import isPlainObject from './isPlainObject'
3
4function typecheck(types, name, obj) {
5 invariant(
6 Array.isArray(types)
7 ? types.some(t => typeof obj === t)
8 : typeof obj === types,
9 `${name} must be ${Array.isArray(types) ? 'one of' : 'a'} ${types}. Instead received a %s.`,
10 typeof obj
11 )
12}
13
14const checks = {
15 buildRequest(fn) {

Callers 10

buildRequestFunction · 0.85
fetchFunction · 0.85
handleResponseFunction · 0.85
methodFunction · 0.85
refreshIntervalFunction · 0.85
RequestFunction · 0.85
thenFunction · 0.85
andThenFunction · 0.85
catchFunction · 0.85
andCatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…