<commit_before>import NullReference from 'ember-gdrive/lib/reference/null-reference';
import get from 'ember-gdrive/lib/reference/get';

var MapReference = function (model, parent, key, data) {
  this.model = model;
  this.parent = parent;
  this.key = key;
  this.data = data;
};

var _isPlainObject = function (o) {
  // This doesn't work for basic objects such as Object.create(null)
  return Object(o) === o && Object.getPrototypeOf(o) === Object.prototype;
};

var _serialize = function (object) {
  if (MapReference.isFor(object)) {
    return MapReference.serialize(object);
  } else {
    return object;
  }
};

MapReference.isFor = function (data) {
  //return data instanceof gapi.drive.realtime.CollaborativeMap;
  return data &&
    data.hasOwnProperty('size') &&
    data.hasOwnProperty('keys') &&
    data.hasOwnProperty('values');
};

// this is used for debugging purposes to get a snapshot of the Google Drive data structure
MapReference.serialize = function (object) {
  var serialized = {};<commit_msg>Resolve issue with breaking MapReference.isFor change in gapi<commit_after>import NullReference from 'ember-gdrive/lib/reference/null-reference';
import get from 'ember-gdrive/lib/reference/get';

var MapReference = function (model, parent, key, data) {
  this.model = model;
  this.parent = parent;
  this.key = key;
  this.data = data;
};

var _isPlainObject = function (o) {
  // This doesn't work for basic objects such as Object.create(null)
  return Object(o) === o && Object.getPrototypeOf(o) === Object.prototype;
};

var _serialize = function (object) {
  if (MapReference.isFor(object)) {
    return MapReference.serialize(object);
  } else {
    return object;
  }
};

MapReference.isFor = function (data) {
  //return data instanceof gapi.drive.realtime.CollaborativeMap;
  return data && data.type === 'Map';
};

// this is used for debugging purposes to get a snapshot of the Google Drive data structure
MapReference.serialize = function (object) {
  var serialized = {};
{'fraction_non_alphanumeric': 0.12562313060817548, 'fraction_numerical': 0.0, 'mean_word_length': 4.186046511627907, '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': '4721808', 'n_tokens_mistral': 601, 'n_tokens_neox': 602, 'n_words': 176}