<commit_before>/**
 * cq TypeScript Engine
 *
 * Parse files with TypeScript
 *
 * Thanks to astexplorer for some of this code
 * see: https://github.com/fkling/astexplorer/tree/master/src/parsers/js/typescript.js#L128
 */
import 'babel-polyfill'
import * as ts from "typescript";
import { rangeExtents } from './util';

const ignoredProperties = new Set([
  'constructor',
  'parent'
]);

function getNodeName(node) {
  if (node.kind) {
    return ts.SyntaxKind[node.kind];
  }
}

function isNode(node) {
  return node && node.kind ? true : false;
}

function traverse(node, nodeCbs) {
  let nodeName = getNodeName(node);
  if (nodeCbs.hasOwnProperty(nodeName)) {<commit_msg>remove babel-polyfill as a required dependency here. see https://phabricator.babeljs.io/T7013<commit_after>/**
 * cq TypeScript Engine
 *
 * Parse files with TypeScript
 *
 * Thanks to astexplorer for some of this code
 * see: https://github.com/fkling/astexplorer/tree/master/src/parsers/js/typescript.js#L128
 */
import * as ts from "typescript";
import { rangeExtents } from './util';

const ignoredProperties = new Set([
  'constructor',
  'parent'
]);

function getNodeName(node) {
  if (node.kind) {
    return ts.SyntaxKind[node.kind];
  }
}

function isNode(node) {
  return node && node.kind ? true : false;
}

function traverse(node, nodeCbs) {
  let nodeName = getNodeName(node);
  if (nodeCbs.hasOwnProperty(nodeName)) {
{'fraction_non_alphanumeric': 0.13423295454545456, 'fraction_numerical': 0.007102272727272727, 'mean_word_length': 4.1611721611721615, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, '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': '4301155', 'n_tokens_mistral': 484, 'n_tokens_neox': 474, 'n_words': 118}