<commit_before>yarn_node_modules() {
    local build_dir=${1:-}

    echo "Installing node modules (yarn.lock)"
    cd "$build_dir"
    yarn install --pure-lockfile --ignore-engines 2>&1
}

npm_node_modules() {
    local build_dir=${1:-}

    if [ -e $build_dir/package.json ]; then
        cd "$build_dir"

        if [ -e $build_dir/npm-shrinkwrap.json ]; then
            echo "Installing development node modules (package.json + shrinkwrap)"
        else
            echo "Installing development node modules (package.json)"
        fi
        npm install --only=dev --unsafe-perm --userconfig $build_dir/.npmrc 2>&1
    else
        echo "Skipping (no package.json)"
    fi
}

list_dependencies() {
    local build_dir="$1"

    cd "$build_dir"
    if $YARN; then
        echo ""
        (yarn list --depth=0 || true) 2>/dev/null
        echo ""
    else
        (npm ls --only=dev --depth=0 | tail -n +2 || true) 2>/dev/null
    fi
}

compile_ts() {<commit_msg>more verbose dependency installation for yarn<commit_after>yarn_node_modules() {
    local build_dir=${1:-}

    if [ -e $build_dir/package.json ]; then
        cd "$build_dir"

        if [ -e $build_dir/yarn.lock ]; then
            echo "Installing node modules (yarn.lock)"
        else
            echo "Installing node modules (yarn)"
        fi
        yarn install --pure-lockfile --production=false --ignore-engines 2>&1
    else
       echo "Skipping (no package.json)"
    fi
}

npm_node_modules() {
    local build_dir=${1:-}

    if [ -e $build_dir/package.json ]; then
        cd "$build_dir"

        if [ -e $build_dir/npm-shrinkwrap.json ]; then
            echo "Installing development node modules (package.json + shrinkwrap)"
        else
            echo "Installing development node modules (npm)"
        fi
        npm install --only=dev --unsafe-perm --userconfig $build_dir/.npmrc 2>&1
    else
        echo "Skipping (no package.json)"
    fi
}

list_dependencies() {
    local build_dir="$1"

    cd "$build_dir"
    if $YARN; then
        echo ""
        (yarn list --depth=0 || true) 2>/dev/null
        echo ""
    else
        (npm ls --only=dev --depth=0 | tail -n +2 || true) 2>/dev/null
    fi
}

compile_ts() {
{'fraction_non_alphanumeric': 0.1305919566199729, 'fraction_numerical': 0.010845006778129237, 'mean_word_length': 2.100840336134454, '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': '2033857', 'n_tokens_mistral': 747, 'n_tokens_neox': 705, 'n_words': 193}