@c8/check-interface

0.1.2 • Public • Published

@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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    0
  • 0.1.1
    1
  • 0.1.0
    1

Package Sidebar

Install

npm i @c8/check-interface

Weekly Downloads

2

Version

0.1.2

License

MIT

Last publish

Collaborators

  • njo_c8
  • c8deploy
  • brooksyd2
  • unlucio