// Copyright 2024 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
import { Children as PreactChildren } from 'preact/compat';
const mapFn = (children, fn) => {
    // eslint-disable-next-line unicorn/no-array-callback-reference
    const mapped = PreactChildren.map(children, fn);
    return mapped == null ? null : Object.freeze(mapped);
};
export const Children = {
    map: mapFn,
    forEach: mapFn,
    count: PreactChildren.count,
    only: PreactChildren.only,
    toArray(children) {
        return Object.freeze(PreactChildren.toArray(children));
    },
};
//# sourceMappingURL=children.js.map