SOLID Principles in JavaScript
What SOLID principle is being violated in this notification system?
class NotificationService {
sendNotification(message: string, type: string) {
if (type === 'email') {
// Send email
} else if (type === 'sms') {
// Send SMS
} else if (type === 'push') {
// Send push notification
} else if (type === 'slack') {
// Send Slack message
}
}
}