UNPKG

class-autobind-decorator

Version:

A small framework-agnostic utility for auto-binding "class" methods to instances (with customization options) using either "legacy" decorator syntax or plain old ES5 (without needing ES2015+ polyfills).

7 lines (5 loc) 197 B
const { toString } = Object.prototype; // This check is "good enough" for purposes here. export default function isObject(candidate) { return toString.call(candidate) === '[object Object]'; }