<commit_before>/* @flow */

import type Site from '../site';

import React from 'react';
import ReactDOMServer from 'react-dom/server';

import Page from '../components/Page';
import { skipMeta, skipDirectories } from './skip-items';

export default function wrapReact(site : Site) : Site {
    return site.mapWithFilters([skipMeta, skipDirectories], (item) => {
        const DOCTYPE = '<!doctype html>';
        const html = DOCTYPE + '\n' + ReactDOMServer.renderToStaticMarkup(
            <Page item={item} />
        );
        return item.withContent(html);
    });
}<commit_msg>Move DOCTYPE definition out of the function<commit_after>/* @flow */

import type Site from '../site';

import React from 'react';
import ReactDOMServer from 'react-dom/server';

import Page from '../components/Page';
import { skipMeta, skipDirectories } from './skip-items';

const DOCTYPE = '<!doctype html>';

export default function wrapReact(site : Site) : Site {
    return site.mapWithFilters([skipMeta, skipDirectories], (item) => {
        const html = DOCTYPE + '\n' + ReactDOMServer.renderToStaticMarkup(
            <Page item={item} />
        );
        return item.withContent(html);
    });
}
{'fraction_non_alphanumeric': 0.14249790444258173, 'fraction_numerical': 0.0, 'mean_word_length': 3.3576642335766422, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1181536', 'n_tokens_mistral': 345, 'n_tokens_neox': 340, 'n_words': 100}