UNPKG

is-hybrid

Version:

Check whether an object looks like Hybrid which is promises-a+ promise and callback api

18 lines (14 loc) 409 B
/*! * is-hybrid <https://github.com/hybridables/is-hybrid> * * Copyright (c) 2015 Charlike Mike Reagent, contributors. * Released under the MIT license. */ 'use strict' var isPromise = require('is-promise') module.exports = function isHybrid (obj) { if (!obj || !obj.hybridify) return false if (typeof obj.hybridify !== 'function') return false if (!isPromise(obj)) return false return true }