MCPcopy Create free account
hub / github.com/codecombat/codecombat / __guardMethod__

Function __guardMethod__

app/views/play/SpectateView.js:497–503  ·  view source on GitHub ↗
(obj, methodName, transform)

Source from the content-addressed store, hash-verified

495 return (typeof value !== 'undefined' && value !== null) ? transform(value) : undefined
496}
497function __guardMethod__ (obj, methodName, transform) {
498 if (typeof obj !== 'undefined' && obj !== null && typeof obj[methodName] === 'function') {
499 return transform(obj, methodName)
500 } else {
501 return undefined
502 }
503}

Callers 1

onNextGamePressedMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected