Comparing version 0.3.0 to 0.3.1
@@ -18,2 +18,8 @@ var https = require('https') | ||
// JS constants | ||
var JSObject = "object" | ||
, JSFunction = "function" | ||
, JSString = "string" | ||
, JSNumber = "number" | ||
// OpenTokSession constructor (only used internally) | ||
@@ -155,12 +161,22 @@ var OpenTokSession = function(sessionId){ | ||
OpenTokSDK.prototype.create_session = function(ipPassthru, properties, callback){ | ||
// Since properties is optional, we need to check the number of parameters passed in | ||
if(!callback){ | ||
callback = properties | ||
} | ||
var sessionId | ||
, params = { | ||
partner_id: this.partnerId, | ||
location_hint: ipPassthru | ||
}; | ||
// No user specified parameter | ||
if( typeof(ipPassthru) == JSFunction ){ | ||
callback = ipPassthru; | ||
} | ||
// location is passed in only | ||
if( typeof(ipPassthru) == JSString && typeof(properties) == JSFunction ){ | ||
callback = properties; | ||
} | ||
// property is passed in only | ||
if( typeof(ipPassthru) == JSObject && typeof(properties) == JSFunction ){ | ||
callback = properties; | ||
properties = ipPassthru; | ||
} | ||
// property and location passed in, do nothing | ||
for(var p in properties){ | ||
@@ -167,0 +183,0 @@ params[p] = properties[p] |
{ | ||
"name": "opentok", | ||
"description": "OpenTokSDK for node.js", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"homepage": "https://github.com/bsstoner/opentok", | ||
@@ -6,0 +6,0 @@ "repository": "https://github.com/bsstoner/opentok.git", |
@@ -12,3 +12,3 @@ # OpenTokSDK for Node.js | ||
"dependencies" : { | ||
"opentok" : "0.2.x", | ||
"opentok" : "0.3.x", | ||
... | ||
@@ -22,2 +22,8 @@ } | ||
### Require the `opentok` module | ||
Add the following code to the top of any file using the `opentok` module: | ||
var OpenTok = require('opentok'); | ||
### API key and API secret | ||
@@ -24,0 +30,0 @@ |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
21710
302
142
3