<commit_before>const is = require('is_js');

const vakt = {};
vakt.VERSION = '0.1.0';

vakt.is = is;

vakt.types = [
  'array',
  'boolean',
  'date',
  'decimal',
  'function',
  'integer',
  'number',
  'object',
  'regexp',
  'string',
];

vakt.customTypes = {};

// helper function which validates variable argument to make sure it matches { name: value }
vakt._variableIsValid = variable =>
  vakt.is.object(variable) && vakt.is.not.array(variable) && Object.keys(variable).length === 1;

// helper function which returns the proper article for a word (most of the time)
vakt._getArticle = word => (['a', 'e', 'i', 'o', 'u', 'y'].includes(word[0]) ? 'an' : 'a');

// helper function which formats error messages
vakt._formatErrorMessage = (name, type) => `${name} must be ${vakt._getArticle(type)} ${type}`;

vakt.check = (variable, type) => {
  // handle multiple checks at once
  if (vakt.is.array(variable) && vakt.is.undefined(type)) {<commit_msg>feat: read version from package.json<commit_after>const is = require('is_js');

const vakt = {};
vakt.VERSION = require('./package.json').version;

vakt.is = is;

vakt.types = [
  'array',
  'boolean',
  'date',
  'decimal',
  'function',
  'integer',
  'number',
  'object',
  'regexp',
  'string',
];

vakt.customTypes = {};

// helper function which validates variable argument to make sure it matches { name: value }
vakt._variableIsValid = variable =>
  vakt.is.object(variable) && vakt.is.not.array(variable) && Object.keys(variable).length === 1;

// helper function which returns the proper article for a word (most of the time)
vakt._getArticle = word => (['a', 'e', 'i', 'o', 'u', 'y'].includes(word[0]) ? 'an' : 'a');

// helper function which formats error messages
vakt._formatErrorMessage = (name, type) => `${name} must be ${vakt._getArticle(type)} ${type}`;

vakt.check = (variable, type) => {
  // handle multiple checks at once
  if (vakt.is.array(variable) && vakt.is.undefined(type)) {
{'fraction_non_alphanumeric': 0.18765935747067822, 'fraction_numerical': 0.0035696073431922487, 'mean_word_length': 4.190476190476191, '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': '5403872', 'n_tokens_mistral': 673, 'n_tokens_neox': 672, 'n_words': 182}