emoji-mart-lazyload/src/polyfills/possibleConstructorReturn.js

12 lines
285 B
JavaScript

export default function possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError(
"this hasn't been initialised - super() hasn't been called",
)
}
return call && (typeof call === 'object' || typeof call === 'function')
? call
: self
}