<commit_before>﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

namespace TextAdventures.Utility.JSInterop
{
    public static class JavaScriptParameterHelpers
    {
        public static string StringParameter(string param)
        {
            return string.Format("\"{0}\"", param.Replace("\"", "\\\"").Replace(Environment.NewLine, "\\n"));
        }
    }

    public interface IJavaScriptParameter
    {
        string GetParameter();
    }

    public class StringParameter : IJavaScriptParameter
    {
        private string m_param;

        public StringParameter(string param)
        {
            if (param == null) param = string.Empty;<commit_msg>Escape backslashes in JS strings<commit_after>﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

namespace TextAdventures.Utility.JSInterop
{
    public static class JavaScriptParameterHelpers
    {
        public static string StringParameter(string param)
        {
            return string.Format("\"{0}\"", param.Replace("\\", "\\\\").Replace("\"", "\\\"").Replace(Environment.NewLine, "\\n"));
        }
    }

    public interface IJavaScriptParameter
    {
        string GetParameter();
    }

    public class StringParameter : IJavaScriptParameter
    {
        private string m_param;

        public StringParameter(string param)
        {
            if (param == null) param = string.Empty;
{'fraction_non_alphanumeric': 0.11207471647765177, 'fraction_numerical': 0.00133422281521014, 'mean_word_length': 2.7593984962406015, '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': '6570995', 'n_tokens_mistral': 398, 'n_tokens_neox': 385, 'n_words': 96}