<commit_before>'use strict';

const
	$C = require('collection.js'),
	joi = require('joi'),
	Sugar = require('sugar');

const
	cliArgv = require('../core/argv'),
	bultInTypes = require('../core/types');

const
	paramsSchema = joi.object().keys({
		default: joi.any().default(null),

		argv: joi.alternatives().try(joi.string().min(1), joi.boolean()).default(true),

		env: joi.alternatives().try(joi.string().min(1), joi.boolean()).default(true),

		short: joi
			.string()
			.min(1)
			.max(1)
			.regex(/^[a-z]$/i, 'short flag name')
			.default(null),

		type: joi.valid(Object.keys(bultInTypes)),

		valuesFlags: joi.alternatives(joi.array().items(joi.string()), joi.object()),

		coerce: joi.func(),

		validate: joi.alternatives(joi.func(), joi.object().type(RegExp), joi.array())
	});

/**
 *
 * @param {string} name
 * @param {Object} [params = {}]
 * @param {?} [params.default]
 * @param {boolean | string} [params.argv = true]
 * @param {boolean | string} [params.env = false]<commit_msg>:wrench: поправил jsdoc<commit_after>'use strict';

const
	$C = require('collection.js'),
	joi = require('joi'),
	Sugar = require('sugar');

const
	cliArgv = require('../core/argv'),
	bultInTypes = require('../core/types');

const
	paramsSchema = joi.object().keys({
		default: joi.any().default(null),

		argv: joi.alternatives().try(joi.string().min(1), joi.boolean()).default(true),

		env: joi.alternatives().try(joi.string().min(1), joi.boolean()).default(true),

		short: joi
			.string()
			.min(1)
			.max(1)
			.regex(/^[a-z]$/i, 'short flag name')
			.default(null),

		type: joi.valid(Object.keys(bultInTypes)),

		valuesFlags: joi.alternatives(joi.array().items(joi.string()), joi.object()),

		coerce: joi.func(),

		validate: joi.alternatives(joi.func(), joi.object().type(RegExp), joi.array())
	});

/**
 *
 * @param {string} name
 * @param {Object} [params = {}]
 * @param {?} [params.default]
 * @param {boolean | string} [params.argv = true]
 * @param {boolean | string} [params.env = true]
{'fraction_non_alphanumeric': 0.22521175884404585, 'fraction_numerical': 0.003986048829098156, 'mean_word_length': 4.270341207349081, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '760756', 'n_tokens_mistral': 803, 'n_tokens_neox': 749, 'n_words': 129}