Home Manual Reference Source Repository

all/@jali-ms/core/src/notification-message-iterables.js

import { Errors, Iterables } from '@jali-ms/util';
import MessageSeverity from './message-severity';
export function error(messages) {
    Errors.verifyIterable('messages', messages);
    return Iterables.find(get_Errors(messages));
}
export function get_Errors(messages) {
    Errors.verifyIterable('messages', messages);
    return Iterables.filter(messages, message => message.severity <= MessageSeverity.Error);
}