<commit_before>import {List, firstOverlappingNode} from './8.5';

declare function require(name: string): any;
const assert = require('assert');

const make = (length: number) => Array.from({length}, index => ({index}));
const link = (...nodes: List[]) => nodes.forEach((n, i) => n.next = nodes[i + 1]);

{
    const [a, b, c, d, e] = make(5);
    link(a, b, c);
    link(d, e);
    assert.strictEqual(firstOverlappingNode(a, d), undefined);
}

{
    const [a, b, c, d] = make(4);
    link(a, b, c);
    link(d, b);
    assert.strictEqual(firstOverlappingNode(a, d), b);
}

{
    const [a] = make(1);
    assert.strictEqual(firstOverlappingNode(a, a), a);
}

{
    const [a, b] = make(2);
    link(a, b);
    assert.strictEqual(firstOverlappingNode(a, a), a);
}

{
    const [a, b] = make(2);
    assert.strictEqual(firstOverlappingNode(a, b), undefined);
}

{
    const [a, b] = make(2);
    link(a, b);
    assert.strictEqual(firstOverlappingNode(a, b), b);
}

{
    const [a, b, c, d, e] = make(5);
    link(a, b, c);
    link(d, e, c);
    assert.strictEqual(firstOverlappingNode(a, d), c);
}

{
    const [a, b, c, d, e, f] = make(6);
    link(a, b, c);
    link(d, e, f, a);
    assert.strictEqual(firstOverlappingNode(a, d), a);
}
<commit_msg>[EPI/8.5/typescript] Convert to new TS version<commit_after>import {List, firstOverlappingNode} from './8.5';

declare function require(name: string): any;
const assert = require('assert');

const make = (length: number) => Array.from({length}, index => ({index} as List));
const link = (...nodes: List[]) => nodes.forEach((n, i) => n.next = nodes[i + 1]);

{
    const [a, b, c, d, e] = make(5);
    link(a, b, c);
    link(d, e);
    assert.strictEqual(firstOverlappingNode(a, d), undefined);
}

{
    const [a, b, c, d] = make(4);
    link(a, b, c);
    link(d, b);
    assert.strictEqual(firstOverlappingNode(a, d), b);
}

{
    const [a] = make(1);
    assert.strictEqual(firstOverlappingNode(a, a), a);
}

{
    const [a, b] = make(2);
    link(a, b);
    assert.strictEqual(firstOverlappingNode(a, a), a);
}

{
    const [a, b] = make(2);
    assert.strictEqual(firstOverlappingNode(a, b), undefined);
}

{
    const [a, b] = make(2);
    link(a, b);
    assert.strictEqual(firstOverlappingNode(a, b), b);
}

{
    const [a, b, c, d, e] = make(5);
    link(a, b, c);
    link(d, e, c);
    assert.strictEqual(firstOverlappingNode(a, d), c);
}

{
    const [a, b, c, d, e, f] = make(6);
    link(a, b, c);
    link(d, e, f, a);
    assert.strictEqual(firstOverlappingNode(a, d), a);
}

{'fraction_non_alphanumeric': 0.2073986619441165, 'fraction_numerical': 0.009445100354191263, 'mean_word_length': 3.3452991452991454, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5976497', 'n_tokens_mistral': 1043, 'n_tokens_neox': 1036, 'n_words': 253}