<commit_before>var bson = require('bson');

/**
 * Map of all extended types to serializers (stringify) and deserializers (parse).
 *
 * @api private
 */
module.exports = {
  serialize: {
    ObjectID: function(v) {
      return {
        $oid: v.toString()
      };
    },
    Binary: function(v) {
      return {
        $binary: v.buffer.toString('base64'),
        $type: v.sub_type.toString(16)
      };
    },
    DBRef: function(v) {
      var id = typeof v.oid === 'object'
      && module.exports.serialize[v.oid.constructor.name] ? module.exports.serialize[v.oid.constructor.name](v.oid)
        : v.oid;
      return {
        $ref: v.namespace,
        $id: id
      };
    },
    Timestamp: function(v) {
      return {
        $timestamp: {
          t: v.low_,
          i: v.high_<commit_msg>explicitly call toHexString on ObjectId's<commit_after>var bson = require('bson');

/**
 * Map of all extended types to serializers (stringify) and deserializers (parse).
 *
 * @api private
 */
module.exports = {
  serialize: {
    ObjectID: function(v) {
      return {
        $oid: bson.ObjectID.prototype.toHexString.call(v)
      };
    },
    Binary: function(v) {
      return {
        $binary: v.buffer.toString('base64'),
        $type: v.sub_type.toString(16)
      };
    },
    DBRef: function(v) {
      var id = typeof v.oid === 'object'
      && module.exports.serialize[v.oid.constructor.name] ? module.exports.serialize[v.oid.constructor.name](v.oid)
        : v.oid;
      return {
        $ref: v.namespace,
        $id: id
      };
    },
    Timestamp: function(v) {
      return {
        $timestamp: {
          t: v.low_,
          i: v.high_
{'fraction_non_alphanumeric': 0.15044776119402986, 'fraction_numerical': 0.004776119402985075, 'mean_word_length': 2.0472727272727274, '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': '1734302', 'n_tokens_mistral': 560, 'n_tokens_neox': 548, 'n_words': 109}