@c8/check-interface
Super tiny lib on top of check-types npm package to check object interfaces
Installation
npm i @c8/check-interface
Usage
const checkInterface = require('@c8/check-interface')
class MyInterface {
constructor () {
checkInterface(this, ['foo', 'bar'])
}
}
class Foo extends MyInterface {
constructor () {
super()
}
foo () {
return
}
}
let fooClass = new Foo() // will throw an Error as bar isn't implemented