<commit_before>/* jshint node: true, bitwise: true, curly: true, eqeqeq: true, forin: true, freeze: true, immed: true, indent: 4, latedef: true, newcap: true, noarg: true, noempty: true, nonbsp: true, nonew: true, quotmark: double, undef: true, unused: true, strict: true, trailing: true */
/* global describe, before, it */

"use strict";

var appDataPath = "../App_Data/PassWeb"; // ASP.NET
//var appDataPath = "../NodeJs/App_Data"; // Node.js

var ALLOW_LIST = false;
var BACKUP_FILE = true;
var BLOCK_NEW = true;

var fs = require("fs");
var path = require("path");
var assert = require("assert");
var request = require("supertest");
request = request("http://localhost/RemoteStorage/");

var goodFiles = [
  {
    name: "first.txt",
    data: "hello\nthere"
  },
  {
    name: "second.png",
    data: "hello\r\nthere"
  },
  {
    name: "third",
    data: "\t\x00\\"
  },
  {
    name: "zero",
    data: ""
  }
];
var badFileNames = [
  { name: "../a" },
  { name: "..\\b" },
  { name: "c/d" },
  { name: "e\\f" },
  { name: "g/../../h" }
];

function resetStorage() {<commit_msg>Create data directory if not present for testing.<commit_after>/* jshint node: true, bitwise: true, curly: true, eqeqeq: true, forin: true, freeze: true, immed: true, indent: 4, latedef: true, newcap: true, noarg: true, noempty: true, nonbsp: true, nonew: true, quotmark: double, undef: true, unused: true, strict: true, trailing: true */
/* global describe, before, it */

"use strict";

var appDataPath = "../App_Data/PassWeb"; // ASP.NET
//var appDataPath = "../NodeJs/App_Data"; // Node.js

var ALLOW_LIST = false;
var BACKUP_FILE = true;
var BLOCK_NEW = true;

var fs = require("fs");
var path = require("path");
var assert = require("assert");
var request = require("supertest");
request = request("http://localhost/RemoteStorage/");

var goodFiles = [
  {
    name: "first.txt",
    data: "hello\nthere"
  },
  {
    name: "second.png",
    data: "hello\r\nthere"
  },
  {
    name: "third",
    data: "\t\x00\\"
  },
  {
    name: "zero",
    data: ""
  }
];
var badFileNames = [
  { name: "../a" },
  { name: "..\\b" },
  { name: "c/d" },
  { name: "e\\f" },
  { name: "g/../../h" }
];

function resetStorage() {
  if (!fs.existsSync(appDataPath)) {
    fs.mkdirSync(appDataPath);
  }
{'fraction_non_alphanumeric': 0.20149253731343283, 'fraction_numerical': 0.0026338893766461808, 'mean_word_length': 3.158759124087591, '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': '6397960', 'n_tokens_mistral': 855, 'n_tokens_neox': 839, 'n_words': 226}