浏览代码

apikey -> key

Michelle Bu 12 年之前
父节点
当前提交
b633066161
共有 4 个文件被更改,包括 9 次插入9 次删除
  1. 3 3
      demo/static/peer.js
  2. 3 3
      dist/peer.js
  3. 0 0
      dist/peer.min.js
  4. 3 3
      lib/peer.js

+ 3 - 3
demo/static/peer.js

@@ -858,12 +858,12 @@ function Peer(options) {
   // Ensure alphanumeric_-
   // Ensure alphanumeric_-
   if (options.id && !/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.exec(options.id))
   if (options.id && !/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.exec(options.id))
     throw new Error('Peer ID can only contain alphanumerics, "_", and "-".');
     throw new Error('Peer ID can only contain alphanumerics, "_", and "-".');
-  if (options.apikey && !/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.exec(options.apikey))
+  if (options.key && !/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.exec(options.key))
     throw new Error('API key can only contain alphanumerics, "_", and "-".');
     throw new Error('API key can only contain alphanumerics, "_", and "-".');
 
 
   this._id = options.id;
   this._id = options.id;
   // Not used unless using cloud server.
   // Not used unless using cloud server.
-  this._apikey = options.apikey;
+  this._key = options.key;
 
 
   this._startSocket();
   this._startSocket();
 
 
@@ -878,7 +878,7 @@ util.inherits(Peer, EventEmitter);
 
 
 Peer.prototype._startSocket = function() {
 Peer.prototype._startSocket = function() {
   var self = this;
   var self = this;
-  this._socket = new Socket(this._server, this._id, this._apikey);
+  this._socket = new Socket(this._server, this._id, this._key);
   this._socket.on('message', function(data) {
   this._socket.on('message', function(data) {
     self._handleServerJSONMessage(data);
     self._handleServerJSONMessage(data);
   });
   });

+ 3 - 3
dist/peer.js

@@ -858,12 +858,12 @@ function Peer(options) {
   // Ensure alphanumeric_-
   // Ensure alphanumeric_-
   if (options.id && !/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.exec(options.id))
   if (options.id && !/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.exec(options.id))
     throw new Error('Peer ID can only contain alphanumerics, "_", and "-".');
     throw new Error('Peer ID can only contain alphanumerics, "_", and "-".');
-  if (options.apikey && !/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.exec(options.apikey))
+  if (options.key && !/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.exec(options.key))
     throw new Error('API key can only contain alphanumerics, "_", and "-".');
     throw new Error('API key can only contain alphanumerics, "_", and "-".');
 
 
   this._id = options.id;
   this._id = options.id;
   // Not used unless using cloud server.
   // Not used unless using cloud server.
-  this._apikey = options.apikey;
+  this._key = options.key;
 
 
   this._startSocket();
   this._startSocket();
 
 
@@ -878,7 +878,7 @@ util.inherits(Peer, EventEmitter);
 
 
 Peer.prototype._startSocket = function() {
 Peer.prototype._startSocket = function() {
   var self = this;
   var self = this;
-  this._socket = new Socket(this._server, this._id, this._apikey);
+  this._socket = new Socket(this._server, this._id, this._key);
   this._socket.on('message', function(data) {
   this._socket.on('message', function(data) {
     self._handleServerJSONMessage(data);
     self._handleServerJSONMessage(data);
   });
   });

文件差异内容过多而无法显示
+ 0 - 0
dist/peer.min.js


+ 3 - 3
lib/peer.js

@@ -19,12 +19,12 @@ function Peer(options) {
   // Ensure alphanumeric_-
   // Ensure alphanumeric_-
   if (options.id && !/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.exec(options.id))
   if (options.id && !/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.exec(options.id))
     throw new Error('Peer ID can only contain alphanumerics, "_", and "-".');
     throw new Error('Peer ID can only contain alphanumerics, "_", and "-".');
-  if (options.apikey && !/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.exec(options.apikey))
+  if (options.key && !/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.exec(options.key))
     throw new Error('API key can only contain alphanumerics, "_", and "-".');
     throw new Error('API key can only contain alphanumerics, "_", and "-".');
 
 
   this._id = options.id;
   this._id = options.id;
   // Not used unless using cloud server.
   // Not used unless using cloud server.
-  this._apikey = options.apikey;
+  this._key = options.key;
 
 
   this._startSocket();
   this._startSocket();
 
 
@@ -39,7 +39,7 @@ util.inherits(Peer, EventEmitter);
 
 
 Peer.prototype._startSocket = function() {
 Peer.prototype._startSocket = function() {
   var self = this;
   var self = this;
-  this._socket = new Socket(this._server, this._id, this._apikey);
+  this._socket = new Socket(this._server, this._id, this._key);
   this._socket.on('message', function(data) {
   this._socket.on('message', function(data) {
     self._handleServerJSONMessage(data);
     self._handleServerJSONMessage(data);
   });
   });

部分文件因为文件数量过多而无法显示