<commit_before>"use strict";

var m = require("mithril"),
    
    children = require("../types/children"),
    db       = require("../lib/firebase"),
    update   = require("../lib/update");

module.exports = {
    controller : function() {
        var ctrl = this,
            
            entry  = db.child("content/" + m.route.param("id")),
            schema = db.child("schemas/" + m.route.param("schema"));
        
        ctrl.ref    = entry;
        ctrl.entry  = null;
        ctrl.schema = null;
        
        entry.on("value", function(snap) {
            ctrl.entry = snap.val();
            
            if(!ctrl.entry.data) {<commit_msg>Blow up on invalid content references<commit_after>"use strict";

var m = require("mithril"),
    
    children = require("../types/children"),
    db       = require("../lib/firebase"),
    update   = require("../lib/update");

module.exports = {
    controller : function() {
        var ctrl = this,
            
            entry  = db.child("content/" + m.route.param("id")),
            schema = db.child("schemas/" + m.route.param("schema"));
        
        ctrl.ref    = entry;
        ctrl.entry  = null;
        ctrl.schema = null;
        
        entry.on("value", function(snap) {
            if(!snap.exists()) {
                return m.route("/content");
            }

            ctrl.entry = snap.val();

            if(!ctrl.entry.data) {
{'fraction_non_alphanumeric': 0.16596045197740114, 'fraction_numerical': 0.0, 'mean_word_length': 1.6192236598890943, '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': '2810295', 'n_tokens_mistral': 409, 'n_tokens_neox': 401, 'n_words': 76}