<commit_before>const { spawn } = require("child_process");
const { resolve: pathResolve } = require("path");

const {
    getPackageJson,
    getProjectDir,
    writePackageJson,
} = require("../projectHelpers");
const { forceUpdateProjectFiles } = require("../helpers/projectFilesManager");
const { forceUpdateProjectDeps } = require("../helpers/dependencyManager");

const PLUGIN_NAME = "@nativescript/webpack";
const PROJECT_DIR = getProjectDir();

function update({
    deps: shouldUpdateDeps,
    configs: shouldUpdateConfigs,
    projectDir = PROJECT_DIR
} = {}) {

    const commands = [];

    if (shouldUpdateDeps) {
        commands.push(() => updateDeps(projectDir));
    }

    if (shouldUpdateConfigs) {
        commands.push(() => Promise.resolve(updateConfigs(projectDir)));
    }

    return commands.reduce((current, next) => current.then(next), Promise.resolve());
}

function updateDeps(projectDir) {
    console.info("Updating dev dependencies...");<commit_msg>fix(webpack): verify now works properly<commit_after>const { spawn } = require("child_process");
const { resolve: pathResolve } = require("path");

const {
    getPackageJson,
    getProjectDir,
    writePackageJson,
} = require("../helpers/projectHelpers");
const { forceUpdateProjectFiles } = require("../helpers/projectFilesManager");
const { forceUpdateProjectDeps } = require("../helpers/dependencyManager");

const PLUGIN_NAME = "@nativescript/webpack";
const PROJECT_DIR = getProjectDir();

function update({
    deps: shouldUpdateDeps,
    configs: shouldUpdateConfigs,
    projectDir = PROJECT_DIR
} = {}) {

    const commands = [];

    if (shouldUpdateDeps) {
        commands.push(() => updateDeps(projectDir));
    }

    if (shouldUpdateConfigs) {
        commands.push(() => Promise.resolve(updateConfigs(projectDir)));
    }

    return commands.reduce((current, next) => current.then(next), Promise.resolve());
}

function updateDeps(projectDir) {
    console.info("Updating dev dependencies...");
{'fraction_non_alphanumeric': 0.14729458917835672, 'fraction_numerical': 0.0, 'mean_word_length': 4.397297297297297, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7466179', 'n_tokens_mistral': 572, 'n_tokens_neox': 572, 'n_words': 107}