<commit_before>import trackJqueryApis from './tracker'

export default function () {
  let shouldTrack = true;

  ['jQuery', '$'].map((propOfJquery) => {
    let value = undefined

    Reflect.defineProperty(window, propOfJquery, {
      set: function (jquery) {
        if (shouldTrack) {
          trackJqueryApis(jquery)
          shouldTrack = false
        }
        value = jquery
      },
      get: function () {
        return value
      }
    })
  })
}<commit_msg>[refine] change jquery hook strategy<commit_after>import trackJqueryApis from './tracker'

export default function () {
  let __jquery__ = null;

  ['jQuery', '$'].map((propOfJquery) => {
    let value = undefined

    Reflect.defineProperty(window, propOfJquery, {
      set: function (jquery) {
        if (jquery !== __jquery__) {
          trackJqueryApis(jquery)
          __jquery__ = jquery
        }
        value = jquery
      },
      get: function () {
        return value
      }
    })
  })
}
{'fraction_non_alphanumeric': 0.12118126272912423, 'fraction_numerical': 0.0, 'mean_word_length': 2.201954397394137, 'pattern_counts': {'":': 0, '<': 3, '<?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': '112775', 'n_tokens_mistral': 296, 'n_tokens_neox': 285, 'n_words': 67}