Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
assert(notificationData.length === 1 || notificationData.length === 2); // as per spec part 3.
// istanbul ignore next
if (doDebug) {
debugLog(chalk.yellow("Subscription#_addNotificationMessage"),
notificationData.toString());
}
const subscription = this;
assert(_.isObject(notificationData[0]));
assert_validNotificationData(notificationData[0]);
if (notificationData.length === 2) {
assert_validNotificationData(notificationData[1]);
}
const notification_message = new NotificationMessage({
notificationData,
publishTime: new Date(),
sequenceNumber: this._get_next_sequence_number()
});
subscription._pending_notifications.push({
notification: notification_message,
publishTime: new Date(),
sequenceNumber: notification_message.sequenceNumber,
start_tick: subscription.publishIntervalCount
});
debugLog("pending notification to send ", subscription._pending_notifications.length);
}