<commit_before>'use strict';

var parse = require('./parse');
var download = require('./download');

module.exports = function convertTumblr(options, callback) {
    if (!options.host) {
        return setImmediate(callback, new Error('`options.host` must be specified'));
    }

    if (!options.apiKey) {
        return setImmediate(callback, new Error('`options.apiKey` must be specified'));
    }

    download(options.host, options.apiKey, function onResponse(err, posts) {
        if (err) {
            return callback(err);
        }

        callback(null, posts.map(function parsePost(post) {
            var bodyField = post.body || post.caption || post.text || post.description;
            var pmNode = bodyField && parse(bodyField, options.schema);
            return {
                raw: post,
                prosemirror: options.json && pmNode ? pmNode.toJSON() : pmNode
            };
        }));
    });
};
<commit_msg>Change `raw` to `tumblr`<commit_after>'use strict';

var parse = require('./parse');
var download = require('./download');

module.exports = function convertTumblr(options, callback) {
    if (!options.host) {
        return setImmediate(callback, new Error('`options.host` must be specified'));
    }

    if (!options.apiKey) {
        return setImmediate(callback, new Error('`options.apiKey` must be specified'));
    }

    download(options.host, options.apiKey, function onResponse(err, posts) {
        if (err) {
            return callback(err);
        }

        callback(null, posts.map(function parsePost(post) {
            var bodyField = post.body || post.caption || post.text || post.description;
            var pmNode = bodyField && parse(bodyField, options.schema);
            return {
                tumblr: post,
                prosemirror: options.json && pmNode ? pmNode.toJSON() : pmNode
            };
        }));
    });
};

{'fraction_non_alphanumeric': 0.1371308016877637, 'fraction_numerical': 0.0, 'mean_word_length': 2.4241877256317688, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3253502', 'n_tokens_mistral': 533, 'n_tokens_neox': 519, 'n_words': 125}