cometd-nodejs-server
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -107,2 +107,13 @@ var crypto = require('crypto'); | ||
function _serialize(message) { | ||
if (message._json) { | ||
return message; | ||
} else { | ||
// Non enumerable property '_json' caches the JSON representation. | ||
return Object.defineProperty(message, '_json', { | ||
value: JSON.stringify(message) | ||
}); | ||
} | ||
} | ||
function ServerTransport(cometd) { | ||
@@ -146,5 +157,7 @@ this._option = function(options, prefix, name, dftValue) { | ||
} | ||
ServerTransport.extends = function(parentObject) { | ||
function F() { | ||
} | ||
F.prototype = parentObject; | ||
@@ -698,4 +711,4 @@ return new F(); | ||
callback = callback || function() { | ||
return undefined; | ||
}; | ||
return undefined; | ||
}; | ||
cometd._publish(this, sender, { | ||
@@ -913,3 +926,3 @@ channel: name, | ||
// TODO: avoid delivering to self ? | ||
_offer(message); | ||
_offer(_serialize(message)); | ||
if (_batch === 0) { | ||
@@ -1304,7 +1317,4 @@ this._flush(); | ||
// Non enumerable property '_json' cached to avoid | ||
// generating the JSON string for each subscriber. | ||
message = Object.defineProperty(message, '_json', { | ||
value: JSON.stringify(message) | ||
}); | ||
// Avoid generating the JSON string for each subscriber. | ||
message = _serialize(message); | ||
@@ -1311,0 +1321,0 @@ channels.forEach(function(channel) { |
{ | ||
"name": "cometd-nodejs-server", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "CometD server for NodeJS", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
127138
2670