export function partition(array, predicate) {
    const matches = [];
    const rest = [];
    for (const element of array) {
        if (predicate(element)) {
            matches.push(element);
        }
        else {
            rest.push(element);
        }
    }
    return [matches, rest];
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFydGl0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsicGFydGl0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9CQSxNQUFNLFVBQVUsU0FBUyxDQUN2QixLQUFtQixFQUNuQixTQUE2QjtJQUU3QixNQUFNLE9BQU8sR0FBYSxFQUFFLENBQUM7SUFDN0IsTUFBTSxJQUFJLEdBQWEsRUFBRSxDQUFDO0lBRTFCLEtBQUssTUFBTSxPQUFPLElBQUksS0FBSyxFQUFFO1FBQzNCLElBQUksU0FBUyxDQUFDLE9BQU8sQ0FBQyxFQUFFO1lBQ3RCLE9BQU8sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7U0FDdkI7YUFBTTtZQUNMLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7U0FDcEI7S0FDRjtJQUVELE9BQU8sQ0FBQyxPQUFPLEVBQUUsSUFBSSxDQUFDLENBQUM7QUFDekIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8vIENvcHlyaWdodCAyMDE4LTIwMjEgdGhlIERlbm8gYXV0aG9ycy4gQWxsIHJpZ2h0cyByZXNlcnZlZC4gTUlUIGxpY2Vuc2UuXG4vLyBUaGlzIG1vZHVsZSBpcyBicm93c2VyIGNvbXBhdGlibGUuXG5cbi8qKlxuICogUmV0dXJucyBhIHR1cGxlIG9mIHR3byBhcnJheXMgd2l0aCB0aGUgZmlyc3Qgb25lIGNvbnRhaW5pbmcgYWxsIGVsZW1lbnRzIGluIHRoZSBnaXZlbiBhcnJheSB0aGF0IG1hdGNoIHRoZSBnaXZlbiBwcmVkaWNhdGVcbiAqIGFuZC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