MCPcopy Create free account
hub / github.com/aosabook/500lines / monitorCodeUse

Function monitorCodeUse

spreadsheet/code/as-react-livescript/main.js:14196–14201  ·  view source on GitHub ↗

* Provides open-source compatible instrumentation for monitoring certain API * uses before we're ready to issue a warning or refactor. It accepts an event * name which may only contain the characters [a-z0-9_] and an optional data * object with further information.

(eventName, data)

Source from the content-addressed store, hash-verified

14194 */
14195
14196 function monitorCodeUse(eventName, data) {
14197 ("production" !== process.env.NODE_ENV ? invariant(
14198 eventName && !/[^a-z0-9_]/.test(eventName),
14199 'You must provide an eventName using only the characters [a-z0-9_]'
14200 ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));
14201 }
14202
14203 module.exports = monitorCodeUse;
14204

Callers 7

main.jsFile · 0.85
warnAndMonitorForKeyUseFunction · 0.85
monitorUseOfObjectMapFunction · 0.85
checkPropTypesFunction · 0.85
putListenerFunction · 0.85
warnForLegacyFactoryCallFunction · 0.85
warnForPlainFunctionTypeFunction · 0.85

Calls 2

invariantFunction · 0.85
testMethod · 0.45

Tested by

no test coverage detected