<commit_before>'use strict'

var should = require('should'),
	ObjectID = require('mongodb').ObjectID,
	types = [String, Number, Boolean, Object, Array, Date, RegExp, ObjectID]

/**
 * @param {*} actual
 * @param {*} expected
 * @param {boolean} strict
 * @param {string[]} [ignoredKeys=[]] only used if strict is true and only useful in the root level
 * @param {string} [path] used internally
 * @throws if invalid. The exception has a 'path' field with the path name that caused the error
 */
module.exports = function (actual, expected, strict, ignoredKeys, path) {
	var key, subpath

	try {<commit_msg>Update check.js to call toJSON<commit_after>'use strict'

var should = require('should'),
	ObjectID = require('mongodb').ObjectID,
	types = [String, Number, Boolean, Object, Array, Date, RegExp, ObjectID]

/**
 * @param {*} actual
 * @param {*} expected
 * @param {boolean} strict
 * @param {string[]} [ignoredKeys=[]] only used if strict is true and only useful in the root level
 * @param {string} [path] used internally
 * @throws if invalid. The exception has a 'path' field with the path name that caused the error
 */
module.exports = function (actual, expected, strict, ignoredKeys, path) {
	var key, subpath

	try {
		// Call toJSON() if present
		if (actual !== null && actual !== undefined && typeof actual.toJSON === 'function') {
			actual = actual.toJSON()
		}
		if (expected !== null && expected !== undefined && typeof expected.toJSON === 'function') {
			expected = expected.toJSON()
		}	
		
{'fraction_non_alphanumeric': 0.14077990746860541, 'fraction_numerical': 0.0, 'mean_word_length': 4.312280701754386, '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': '3149308', 'n_tokens_mistral': 456, 'n_tokens_neox': 438, 'n_words': 172}