<commit_before>var osdi = require('../lib/osdi'),
  bridge = require('../lib/bridge'),
  config = require('../config');

function getAll(req, res) {
  var vanClient = bridge.createClient(req);
  var vanPaginationParams = bridge.getVANPaginationParams(req);

  var resourcePromise = vanClient.resultCodes.getMany(null, null, null,
    vanPaginationParams.top, vanPaginationParams.skip);

  bridge.sendSingleResourceResponse(resourcePromise, oneArrayTranslator,
    'response_codes', res);

}

function getAll2(req, res) {
  var vanClient = bridge.createClient(req);
  var vanPaginationParams = bridge.getVANPaginationParams(req);

  var resourcePromise = vanClient.resultCodes.getMany(null, null, null,
    vanPaginationParams.top, vanPaginationParams.skip);

  bridge.sendSingleResourceResponse(resourcePromise, arrayTranslator,
    'response_codes', res);

}

function arrayTranslator(res) {
  var answer=res.map(function (rc){
    return {
      response_code: rc.resultCodeId,
      name: rc.name

    }
  } );

  return answer;
}
function oneArrayTranslator(res) {
  var answer = osdi.response.createCommonItem(
    "Available response codes",
    "Available response codes");

  osdi.response.addIdentifier(answer, 'VAN:ResultCodes');
  osdi.response.addLink(answer, 'self', 'metadata/canvass_response_codes');
  osdi.response.addCurie(answer, config.get('curieTemplate'));

  answer.response_codes=res.map(function (rc){
    return {
      response_code: rc.resultCodeId,
      name: rc.name

    }
  } );

  return answer;
}
function oneResourceTranslator(rc) {
  console.info(rc);



  return answer;
}

module.exports = function (app) {
  app.get('/api/v1/metadata/canvass_response_codes', getAll);
  app.get('/api/v1/metadata/canvass_response_codes2', getAll2);
};
<commit_msg>convert resultCodeId to string<commit_after>var osdi = require('../lib/osdi'),
  bridge = require('../lib/bridge'),
  config = require('../config');

function getAll(req, res) {
  var vanClient = bridge.createClient(req);
  var vanPaginationParams = bridge.getVANPaginationParams(req);

  var resourcePromise = vanClient.resultCodes.getMany(null, null, null,
    vanPaginationParams.top, vanPaginationParams.skip);

  bridge.sendSingleResourceResponse(resourcePromise, oneArrayTranslator,
    'response_codes', res);

}

function getAll2(req, res) {
  var vanClient = bridge.createClient(req);
  var vanPaginationParams = bridge.getVANPaginationParams(req);

  var resourcePromise = vanClient.resultCodes.getMany(null, null, null,
    vanPaginationParams.top, vanPaginationParams.skip);

  bridge.sendSingleResourceResponse(resourcePromise, arrayTranslator,
    'response_codes', res);

}

function arrayTranslator(res) {
  var answer=res.map(function (rc){
    return {
      response_code: rc.resultCodeId,
      name: rc.name

    }
  } );

  return answer;
}
function oneArrayTranslator(res) {
  var answer = osdi.response.createCommonItem(
    "Available response codes",
    "Available response codes");

  osdi.response.addIdentifier(answer, 'VAN:ResultCodes');
  osdi.response.addLink(answer, 'self', 'metadata/canvass_response_codes');
  osdi.response.addCurie(answer, config.get('curieTemplate'));

  answer.response_codes=res.map(function (rc){
    return {
      response_code: String(rc.resultCodeId),
      name: rc.name

    }
  } );

  return answer;
}
function oneResourceTranslator(rc) {
  console.info(rc);



  return answer;
}

module.exports = function (app) {
  app.get('/api/v1/metadata/canvass_response_codes', getAll);
  app.get('/api/v1/metadata/canvass_response_codes2', getAll2);
};

{'fraction_non_alphanumeric': 0.12725757154765213, 'fraction_numerical': 0.0027785495971103086, 'mean_word_length': 4.69620253164557, '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': '746028', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1171, 'n_words': 199}