Comparing version 0.1.5 to 0.1.6
@@ -86,2 +86,10 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Minijanus = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
/** | ||
* Whether this signal represents an error, and the associated promise (if any) should be rejected. | ||
* Users should override this to handle any custom plugin-specific error conventions. | ||
**/ | ||
JanusSession.prototype.isError = function(signal) { | ||
return signal.janus === "error"; | ||
}; | ||
/** | ||
* Callback for receiving JSON signalling messages pertinent to this session. If the signals are responses to previously | ||
@@ -108,3 +116,3 @@ * sent signals, the promises for the outgoing signals will be resolved or rejected appropriately with this signal as an | ||
delete this.txns[signal.transaction]; | ||
(signal.janus === "error" ? handlers.reject : handlers.resolve)(signal); | ||
(this.isError(signal) ? handlers.reject : handlers.resolve)(signal); | ||
} | ||
@@ -111,0 +119,0 @@ } |
@@ -85,2 +85,10 @@ /** Whether to log information about incoming and outgoing Janus signals. **/ | ||
/** | ||
* Whether this signal represents an error, and the associated promise (if any) should be rejected. | ||
* Users should override this to handle any custom plugin-specific error conventions. | ||
**/ | ||
JanusSession.prototype.isError = function(signal) { | ||
return signal.janus === "error"; | ||
}; | ||
/** | ||
* Callback for receiving JSON signalling messages pertinent to this session. If the signals are responses to previously | ||
@@ -107,3 +115,3 @@ * sent signals, the promises for the outgoing signals will be resolved or rejected appropriately with this signal as an | ||
delete this.txns[signal.transaction]; | ||
(signal.janus === "error" ? handlers.reject : handlers.resolve)(signal); | ||
(this.isError(signal) ? handlers.reject : handlers.resolve)(signal); | ||
} | ||
@@ -110,0 +118,0 @@ } |
{ | ||
"name": "minijanus", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Really simple and minimal wrapper for talking to the Janus signalling API.", | ||
@@ -5,0 +5,0 @@ "main": "minijanus.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67192
335