<commit_before>/// <reference path="../../common/models.ts" />
/// <reference path="../../../typings/tsd.d.ts" />

import StyleHelpers = require("./helpers");
import Models = require("../../common/models");
import _ = require("lodash");

export class QuotingStyleRegistry {
	private _mapping : StyleHelpers.QuoteStyle[];
	
	constructor(private _modules: StyleHelpers.QuoteStyle[]) {}
	
	private static NullQuoteGenerator : StyleHelpers.QuoteStyle = new NullQuoteGenerator();
	
	public Get = (mode : Models.QuotingMode) : StyleHelpers.QuoteStyle => {
		var mod = this._modules[mode];
		
		if (typeof mod === "undefined")
			return QuotingStyleRegistry.NullQuoteGenerator;
			
		return mod;
	};
}

class NullQuoteGenerator implements StyleHelpers.QuoteStyle {
	Mode = null;
    
    GenerateQuote = (market: Models.Market, fv: Models.FairValue, params: Models.QuotingParameters) : StyleHelpers.GeneratedQuote => {
		return null;
	};
}<commit_msg>Fix null ref on startup<commit_after>/// <reference path="../../common/models.ts" />
/// <reference path="../../../typings/tsd.d.ts" />

import StyleHelpers = require("./helpers");
import Models = require("../../common/models");
import _ = require("lodash");

class NullQuoteGenerator implements StyleHelpers.QuoteStyle {
	Mode = null;
    
    GenerateQuote = (market: Models.Market, fv: Models.FairValue, params: Models.QuotingParameters) : StyleHelpers.GeneratedQuote => {
		return null;
	};
}

export class QuotingStyleRegistry {
	private _mapping : StyleHelpers.QuoteStyle[];
	
	constructor(private _modules: StyleHelpers.QuoteStyle[]) {}
	
	private static NullQuoteGenerator : StyleHelpers.QuoteStyle = new NullQuoteGenerator();
	
	public Get = (mode : Models.QuotingMode) : StyleHelpers.QuoteStyle => {
		var mod = this._modules[mode];
		
		if (typeof mod === "undefined")
			return QuotingStyleRegistry.NullQuoteGenerator;
			
		return mod;
	};
}
{'fraction_non_alphanumeric': 0.1475237091675448, 'fraction_numerical': 0.0, 'mean_word_length': 4.2027397260273975, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '1360109', 'n_tokens_mistral': 593, 'n_tokens_neox': 531, 'n_words': 124}