<commit_before>//var derby = require('derby');
var icons = require('./icons.js');

function Component() {}

module.exports = Component;

Component.prototype.view = __dirname;

Component.prototype.init = function() {
    /**
     * Mode of icon source
     *
     * @attribute mode
     * @type string
     * @default 'svg'
     * 'svg' || 'img' || 'sprite'
     */
    this.model.setNull('mode', 'svg');

    this.model.setNull('icon', 'add');
    this.model.setNull('data', '');

    this.model.setNull('src', './icons.js');
    this.model.setNull('config', '');
    this.model.setNull('width', '25');
    this.model.setNull('height', '25');
    this.model.setNull('animate', false);
    this.model.setNull('keyframe', '');
//    if (derby.util.isServer) {
        icons = require(this.model.get('src'));
        this.model.set('data', icons[this.model.get('icon')]);
//    }
}

Component.prototype.create = function(){
    if(this.model.get('mode') == 'svg'){
        this.icon.innerHTML = ('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ' +<commit_msg>Temp Fix: Navigating between routes was causing an error:<commit_after>var icons = require('./icons.js');

function Component() {}

module.exports = Component;

Component.prototype.view = __dirname;

Component.prototype.init = function() {
    /**
     * Mode of icon source
     *
     * @attribute mode
     * @type string
     * @default 'svg'
     * 'svg' || 'img' || 'sprite'
     */
    this.model.setNull('mode', 'svg');

    this.model.setNull('icon', 'add');
    this.model.setNull('data', '');

    this.model.setNull('config', '');
    this.model.setNull('width', '25');
    this.model.setNull('height', '25');
    this.model.setNull('animate', false);
    this.model.setNull('keyframe', '');
    // XXX: Loading icons using a `require` was causing an error on route change.
    // FIX: Use a cached variable for the default icons, only require custom icons
    // TODO: test loading of custom icons. Investigate ways to utilize caching
    if (this.model.get('src')) {
        icons = require(this.model.get('src'));
    }
    this.model.set('data', icons[this.model.get('icon')]);
}

Component.prototype.create = function(){
    if(this.model.get('mode') == 'svg'){
        this.icon.innerHTML = ('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ' +
{'fraction_non_alphanumeric': 0.19536281665951052, 'fraction_numerical': 0.009446114212108201, 'mean_word_length': 3.131205673758865, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '1980839', 'n_tokens_mistral': 779, 'n_tokens_neox': 747, 'n_words': 154}