Socket
Socket
Sign inDemoInstall

@c8/check-interface

Package Overview
Dependencies
1
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @c8/check-interface

Super tiny lib on top of check-types npm package to check ES 6 class interfaces


Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
6
Install size
116 kB
Created
Weekly downloads
 

Readme

Source

@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

FAQs

Last updated on 06 May 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc