| 377 | } |
| 378 | |
| 379 | private recordNotification(method: string, params?: unknown): RuntimeNotification { |
| 380 | const notification: RuntimeNotification = params === undefined ? { method } : { method, params } |
| 381 | notification.cursor = String(this.nextNotificationCursor++) |
| 382 | if (this.notificationLogSize > 0) { |
| 383 | this.notificationLog.push(notification) |
| 384 | while (this.notificationLog.length > this.notificationLogSize) this.notificationLog.shift() |
| 385 | } |
| 386 | return notification |
| 387 | } |
| 388 | |
| 389 | private matchesPattern(method: string, pattern: string): boolean { |
| 390 | if (pattern === "*" || pattern === method) return true |