<commit_before>'use strict';
/*!
 * Module requirements.
 */
const mongoose = require('mongoose'),
  uuid = require('uuid'),
  util = require('util'),
  parser = require('./guid-parser');

function getter(binary) {
  if (!binary) return '';
  const len = binary.length();
  const b = binary.read(0, len);
  return parser.GUID(b);
}


function arrayGetter(arr) {
  const result = [];

  if (arr) {
    for (let i = 0; i < arr.length; i++)
      result.push(getter(arr[i]));
  }

  return result;
}

function arraySetter(arr) {
  const result = [];

  if (arr) {
    for (let i = 0; i < arr.length; i++)
      result.push(cast(arr[i]));<commit_msg>Update mongoose-guid.js<commit_after>'use strict';
/*!
 * Module requirements.
 */
const mongoose = require('mongoose'),
  uuid = require('uuid'),
  util = require('util'),
  parser = require('./guid-parser');

function getter(binary) {
  if (!binary) return '';
  
  if (typeof binary === 'string')
    return binary

  const len = binary.length();
  const b = binary.read(0, len);
  return parser.GUID(b);
}


function arrayGetter(arr) {
  const result = [];

  if (arr) {
    for (let i = 0; i < arr.length; i++)
      result.push(getter(arr[i]));
  }

  return result;
}

function arraySetter(arr) {
  const result = [];

  if (arr) {
    for (let i = 0; i < arr.length; i++)
      result.push(cast(arr[i]));
{'fraction_non_alphanumeric': 0.18630338733431517, 'fraction_numerical': 0.004418262150220913, 'mean_word_length': 3.2336448598130842, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6051741', 'n_tokens_mistral': 476, 'n_tokens_neox': 469, 'n_words': 120}