export function mapValues(input, mapper) {
    return mapEntries(input, (k, v) => [k, mapper(v)]);
}
export function mapEntries(input, mapper) {
    // Direct assignment is faster than Object.fromEntries()
    // https://github.com/rocicorp/mono/pull/3927#issuecomment-2706059475
    const output = {};
    // In chrome Object.entries is faster than for-in (13x) or Object.keys (15x)
    // https://gist.github.com/arv/1b4e113724f6a14e2d4742bcc760d1fa
    for (const entry of Object.entries(input)) {
        const mapped = mapper(entry[0], entry[1]);
        output[mapped[0]] = mapped[1];
    }
    return output;
}
export function mapAllEntries(input, mapper) {
    // Direct assignment is faster than Object.fromEntries()
    // https://github.com/rocicorp/mono/pull/3927#issuecomment-2706059475
    const output = {};
    for (const mapped of mapper(Object.entries(input))) {
        output[mapped[0]] = mapped[1];
    }
    return output;
}
//# sourceMappingURL=objects.js.map