<commit_before>var path = require('path');
var reactDocs = require('react-docgen');
var config = require('../src/utils/config');
var isArray = require('lodash/isArray');

var requirePlaceholder = '<%{#require#}%>';

module.exports = function (source) {
	this.cacheable && this.cacheable();

	var defaultPropsParser = function(filePath, source) {
		return reactDocs.parse(source, config.resolver, config.handlers);
	};

	var jsonProps;
	try {
		const file = this.request.split('!').pop()
		var propsParser = config.propsParser || defaultPropsParser;
		var props = propsParser(file, source);

		jsonProps = (isArray(props) ? props : [props]).map(function(doc) {
			if (doc.description) {
				doc.doclets = reactDocs.utils.docblock.getDoclets(doc.description);
				doc.description = doc.description.replace(/^@(\w+)(?:$|\s((?:[^](?!^@\w))*))/gmi, '');<commit_msg>Fixed error reporting showing 'file is not defined' (#173)<commit_after>var path = require('path');
var reactDocs = require('react-docgen');
var config = require('../src/utils/config');
var isArray = require('lodash/isArray');

var requirePlaceholder = '<%{#require#}%>';

module.exports = function (source) {
	this.cacheable && this.cacheable();

	var defaultPropsParser = function(filePath, source) {
		return reactDocs.parse(source, config.resolver, config.handlers);
	};

	var jsonProps;
	const file = this.request.split('!').pop()
	try {
		var propsParser = config.propsParser || defaultPropsParser;
		var props = propsParser(file, source);

		jsonProps = (isArray(props) ? props : [props]).map(function(doc) {
			if (doc.description) {
				doc.doclets = reactDocs.utils.docblock.getDoclets(doc.description);
				doc.description = doc.description.replace(/^@(\w+)(?:$|\s((?:[^](?!^@\w))*))/gmi, '');
{'fraction_non_alphanumeric': 0.1899092970521542, 'fraction_numerical': 0.0017006802721088435, 'mean_word_length': 5.214788732394366, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6165271', 'n_tokens_mistral': 609, 'n_tokens_neox': 567, 'n_words': 112}