<commit_before>'use strict';

const Joi = require('joi');

const Message = require('./Message');


// TODO: url whitelist
// TODO: authentication
class UserRegistrationMessage extends Message {

  constructor(...args) {
    super(...args);

    // Data validation rules.
    this.schema = Joi.object().keys({
      id: Joi.string().regex(/^[0-9a-f]{24}$/, 'valid object id').required(),
    });
  }

  static fromCtx(ctx) {
    // TODO: save more metadata
    // TODO: metadata parse helper
    const userRegistrationMessage = new UserRegistrationMessage({
      data: ctx.request.body,
      meta: {
        request_id: ctx.id,
      },
    });
    return userRegistrationMessage;
  }

}

module.exports = UserRegistrationMessage;
<commit_msg>Remove unnecessary comments<commit_after>'use strict';

const Joi = require('joi');

const Message = require('./Message');

class UserRegistrationMessage extends Message {

  constructor(...args) {
    super(...args);

    // Data validation rules.
    this.schema = Joi.object().keys({
      id: Joi.string().regex(/^[0-9a-f]{24}$/, 'valid object id').required(),
    });
  }

  static fromCtx(ctx) {
    // TODO: save more metadata
    // TODO: metadata parse helper
    const userRegistrationMessage = new UserRegistrationMessage({
      data: ctx.request.body,
      meta: {
        request_id: ctx.id,
      },
    });
    return userRegistrationMessage;
  }

}

module.exports = UserRegistrationMessage;

{'fraction_non_alphanumeric': 0.14718019257221457, 'fraction_numerical': 0.005502063273727648, 'mean_word_length': 2.921832884097035, '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': '7306715', 'n_tokens_mistral': 431, 'n_tokens_neox': 420, 'n_words': 101}