export function findSingle(array, predicate) {
    let match = undefined;
    let found = false;
    for (const element of array) {
        if (predicate(element)) {
            if (found) {
                return undefined;
            }
            found = true;
            match = element;
        }
    }
    return match;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmluZF9zaW5nbGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJmaW5kX3NpbmdsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF3QkEsTUFBTSxVQUFVLFVBQVUsQ0FDeEIsS0FBbUIsRUFDbkIsU0FBNkI7SUFFN0IsSUFBSSxLQUFLLEdBQWtCLFNBQVMsQ0FBQztJQUNyQyxJQUFJLEtBQUssR0FBRyxLQUFLLENBQUM7SUFDbEIsS0FBSyxNQUFNLE9BQU8sSUFBSSxLQUFLLEVBQUU7UUFDM0IsSUFBSSxTQUFTLENBQUMsT0FBTyxDQUFDLEVBQUU7WUFDdEIsSUFBSSxLQUFLLEVBQUU7Z0JBQ1QsT0FBTyxTQUFTLENBQUM7YUFDbEI7WUFDRCxLQUFLLEdBQUcsSUFBSSxDQUFDO1lBQ2IsS0FBSyxHQUFHLE9BQU8sQ0FBQztTQUNqQjtLQUNGO0lBRUQsT0FBTyxLQUFLLENBQUM7QUFDZixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLy8gQ29weXJpZ2h0IDIwMTgtMjAyMSB0aGUgRGVubyBhdXRob3JzLiBBbGwgcmlnaHRzIHJlc2VydmVkLiBNSVQgbGljZW5zZS5cbi8vIFRoaXMgbW9kdWxlIGlzIGJyb3dzZXIgY29tcGF0aWJsZS5cblxuLyoqXG4gKiBSZXR1cm5zIGFuIGVsZW1lbnQgaWYgYW5kIG9ubHkgaWYgdGhhdCBlbGVtZW50IGlzIHRoZSBvbmx5IG9uZSBtYXRjaGluZyB0aGUgZ2l2ZW4gY29uZGl0aW9uLiBSZXR1cm5zIGB1bmRlZmluZWRgIG90aGVyd2lzZS5cbiAqXG4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