boldr/boldr-ui

View on GitHub
src/util/kindOf.js

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * Tests whether MaybeDerive is a covariant of Base
 * @param {Function} MaybeDerive Class to test
 * @param {Function} Base Base class to test against
 * @returns {Function} the type of
 */
export default function kindOf(MaybeDerive, Base) {
  return MaybeDerive === Base || (MaybeDerive && MaybeDerive.prototype instanceof Base);
}