<commit_before>var _ = require('lodash');

module.exports = function (queryObj) {
    return function assumeThatAllHtmlFragmentAssetsWithoutIncomingRelationsAreNotTemplates(assetGraph) {
        assetGraph.findAssets(_.extend({type: 'Html', isFragment: true}, queryObj)).forEach(function (htmlAsset) {
            if (htmlAsset.incomingRelations.length === 0) {
                htmlAsset.isFragment = false;
            }
        });
    };<commit_msg>assumeThatAllHtmlFragmentAssetsWithoutIncomingRelationsAreNotTemplates: Recompute base assets if changes were made.<commit_after>var _ = require('lodash');

module.exports = function (queryObj) {
    return function assumeThatAllHtmlFragmentAssetsWithoutIncomingRelationsAreNotTemplates(assetGraph) {
        var recomputeBaseAssets = false;
        assetGraph.findAssets(_.extend({type: 'Html', isFragment: true}, queryObj)).forEach(function (htmlAsset) {
            if (htmlAsset.incomingRelations.length === 0) {
                recomputeBaseAssets = true;
                htmlAsset.isFragment = false;
            }
        });
        if (recomputeBaseAssets) {
            assetGraph.recomputeBaseAssets(true);
        }
    };
{'fraction_non_alphanumeric': 0.10118043844856661, 'fraction_numerical': 0.0016863406408094434, 'mean_word_length': 3.2697841726618706, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5456058', 'n_tokens_mistral': 325, 'n_tokens_neox': 312, 'n_words': 53}