<commit_before>
var resolve = require('path').resolve
var assert = require('http-assert')

module.exports = function resolvePath(root, path) {
  // just like path.resolve, make root optional
  if (arguments.length === 1) {
    path = root
    root = process.cwd()
  } else {
    root = resolve(root)
  }

  // path should never be absolute
  assert(resolve(path) !== path, 400, 'malicious path')<commit_msg>build: reorganize source file<commit_after>/*!
 * resolve-path
 * Copyright(c) 2014 <NAME>
 * MIT Licensed
 */

/**
 * Module dependencies.
 * @private
 */

var assert = require('http-assert')
var resolve = require('path').resolve

/**
 * Module exports.
 */

module.exports = resolvePath

/**
 * Resolve relative path against a root path
 *
 * @param {string} root
 * @param {string} path
 * @return {string}
 * @public
 */
function resolvePath(root, path) {
  // just like path.resolve, make root optional
  if (arguments.length === 1) {
    path = root
    root = process.cwd()
  } else {
    root = resolve(root)
  }

  // path should never be absolute
  assert(resolve(path) !== path, 400, 'malicious path')
{'fraction_non_alphanumeric': 0.1456657730116175, 'fraction_numerical': 0.010723860589812333, 'mean_word_length': 3.375, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '3881328', 'n_tokens_mistral': 357, 'n_tokens_neox': 342, 'n_words': 104}