<commit_before>'use strict';

const icon = require('./icon.png');
const {
    INPUT_FORMAT,
    OUTPUT_FORMAT,
    ERROR_UNKNOWN,
    getType,
    parse,
    output
} = require('./formatter');

const plugin = ({ term, display, actions }) => {
    let match = term.match(/^(\d{10,13})/);

    //fall back on the ts prefix
    if (!match) {
        match = term.match(/^tsu?\s*($|.*)/);
    }

    if (match) {
        const isUTC = term.startsWith('tsu');
        const input = match[1];

        const type = getType(input); //String
        const moment = parse(input, type, isUTC); //momentJS object<commit_msg>Simplify regex that still allows typing plain 'ts'<commit_after>'use strict';

const icon = require('./icon.png');
const {
    INPUT_FORMAT,
    OUTPUT_FORMAT,
    ERROR_UNKNOWN,
    getType,
    parse,
    output
} = require('./formatter');

const plugin = ({ term, display, actions }) => {
    let match = term.match(/^(\d{10,13})/);

    //fall back on the ts prefix
    if (!match) {
        match = term.match(/^tsu?\s?(.*)/);
    }

    if (match) {
        const isUTC = term.startsWith('tsu');
        const input = match[1];

        const type = getType(input); //String
        const moment = parse(input, type, isUTC); //momentJS object
{'fraction_non_alphanumeric': 0.1681205392545599, 'fraction_numerical': 0.007930214115781126, 'mean_word_length': 2.4861878453038675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3982420', 'n_tokens_mistral': 416, 'n_tokens_neox': 400, 'n_words': 106}