<commit_before>'use strict'

pathUtils = require 'path'

STACK_FILE_PATH = ['lib', 'unit', 'stack.coffee'].join(pathUtils.sep)

exports.toString = (err) ->
    msg = ''
    if err.stack
        msg += err.stack

        unitStackIndex = msg.indexOf STACK_FILE_PATH
        if unitStackIndex >= 0
            msg = msg.slice(0, unitStackIndex) + '…'
    else
        msg += err
    msg += '\n'
    msg<commit_msg>lib/unit stack slicing on windows bug fixed<commit_after>'use strict'

STACK_FILE_PATH = 'lib/unit/stack.coffee'

if process?.platform is 'win32'
    STACK_FILE_PATH = STACK_FILE_PATH.replace /\//g, '\\'

exports.toString = (err) ->
    msg = ''
    if err.stack
        msg += err.stack

        unitStackIndex = msg.indexOf STACK_FILE_PATH
        if unitStackIndex >= 0
            msg = msg.slice(0, unitStackIndex) + '…'
    else
        msg += err
    msg += '\n'
    msg
{'fraction_non_alphanumeric': 0.13160854893138357, 'fraction_numerical': 0.006749156355455568, 'mean_word_length': 2.3333333333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1640616', 'n_tokens_mistral': 305, 'n_tokens_neox': 296, 'n_words': 71}