<commit_before>import * as t from "../../../types";

export var metadata = {
  group: "builtin-trailing"
};

function remap(path, key, create) {
  // ensure that we're shadowed
  if (!path.inShadow()) return;

  var fnPath = path.findParent((path) => !path.is("shadow") && (path.isFunction() || path.isProgram()));

  var shadowed = path.node._shadowedFunctionLiteral;
  if (shadowed && shadowed !== fnPath.node) return;

  var cached = fnPath.getData(key);<commit_msg>rejigger shadowd function findParent logic<commit_after>import * as t from "../../../types";

export var metadata = {
  group: "builtin-trailing"
};

function remap(path, key, create) {
  // ensure that we're shadowed
  if (!path.inShadow()) return;

  var shadowed = path.node._shadowedFunctionLiteral;

  var fnPath = path.findParent(function (path) {
    if (shadowed) {
      return path.node === shadowed;
    } else {
      return !path.is("shadow") && (path.isFunction() || path.isProgram())
    }
  });

  var cached = fnPath.getData(key);
{'fraction_non_alphanumeric': 0.1673228346456693, 'fraction_numerical': 0.0, 'mean_word_length': 3.665137614678899, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3315977', 'n_tokens_mistral': 328, 'n_tokens_neox': 325, 'n_words': 82}