<commit_before>import DS from "ember-data";
import UTF8 from "npm:utf-8";

function bin2String(array) {
  if (array === undefined){
    return "";
  } else {
    return UTF8.getStringFromBytes(array);
  }
}

export default DS.Serializer.extend({
  normalizeResponse: function(store, type, payload, id, requestType) {
    var jsonapiPayload = {};
    if (requestType === "findAll") {
      jsonapiPayload.data = [];<commit_msg>rework bin2String function to work with npm test, ie Phantomjs<commit_after>import DS from "ember-data";

function bin2String(uintArray) {
  var encodedString = String.fromCharCode.apply(null, uintArray),
      decodedString = decodeURIComponent((encodedString));
  return decodedString;
}

export default DS.Serializer.extend({
  normalizeResponse: function(store, type, payload, id, requestType) {
    var jsonapiPayload = {};
    if (requestType === "findAll") {
      jsonapiPayload.data = [];
{'fraction_non_alphanumeric': 0.1256771397616468, 'fraction_numerical': 0.0065005417118093175, 'mean_word_length': 4.566265060240964, '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': '209649', 'n_tokens_mistral': 279, 'n_tokens_neox': 274, 'n_words': 70}