UNPKG

websocket-as-promised

Version:

A WebSocket client library providing Promise-based API for connecting, disconnecting and messaging with server

11 lines (8 loc) 188 B
exports.throwIf = (condition, message) => { if (condition) { throw new Error(message); } }; exports.isPromise = value => { return value && typeof value.then === 'function'; };