<commit_before>import * as Arr from 'ephox/katamari/api/Arr';
import { Assert, UnitTest } from '@ephox/bedrock-client';
import { Option } from 'ephox/katamari/api/Option';
import { tOption } from 'ephox/katamari/api/OptionInstances';
import { Testable as T } from '@ephox/dispute';
import fc from 'fast-check';

UnitTest.test('Arr.last: empty', function () {
  Assert.eq('empty', Option.none<number>(), Arr.last<number>([]), tOption(T.tNumber));
});

UnitTest.test('Arr.last: nonEmpty', function () {
  fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (init, last) => {
    const arr = init.concat([last]);
    Assert.eq('nonEmpty', Option.some(last), Arr.last(arr), tOption(T.tNumber));
  }));
});
<commit_msg>Arrow functions.<commit_after>import * as Arr from 'ephox/katamari/api/Arr';
import { Assert, UnitTest } from '@ephox/bedrock-client';
import { Option } from 'ephox/katamari/api/Option';
import { tOption } from 'ephox/katamari/api/OptionInstances';
import { Testable as T } from '@ephox/dispute';
import fc from 'fast-check';

UnitTest.test('Arr.last: empty', () => {
  Assert.eq('empty', Option.none<number>(), Arr.last<number>([]), tOption(T.tNumber));
});

UnitTest.test('Arr.last: nonEmpty', () => {
  fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (init, last) => {
    const arr = init.concat([last]);
    Assert.eq('nonEmpty', Option.some(last), Arr.last(arr), tOption(T.tNumber));
  }));
});

{'fraction_non_alphanumeric': 0.2069686411149826, 'fraction_numerical': 0.0, 'mean_word_length': 5.163090128755365, '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': '371328', 'n_tokens_mistral': 504, 'n_tokens_neox': 520, 'n_words': 97}