<commit_before>import { KEY_EVENT_LISTENERS } from '../util/const'
import debugMessage from '../util/debug-message'
import check from '../util/check'

declare var __DEV__: boolean

/**
 * The decorator for registering event listener info to the method.
 * @param event The event name
 * @param at The selector
 * @param descriptor The method descriptor
 */
const on: any = (event: string, { at }: { at?: string } = {}) => (
  target: any,
  key: string,
  descriptor: any
) => {
  const constructor = target.constructor
  check(
    !!event,
    `Empty event handler is given: constructor=${constructor.name} key=${key}`
  )
  /**
   * @param el The element
   * @param coelem The coelement
   * @param name The component name
   */
  constructor[KEY_EVENT_LISTENERS] = (
    constructor[KEY_EVENT_LISTENERS] || []
  ).concat((el: HTMLElement, coelem: any, name: string) => {
    const keyEventListeners = KEY_EVENT_LISTENERS + name

    const listener = (e: Event): void => {
      if (
        !at ||
        [].some.call(el.querySelectorAll(at), (node: Node) => {
          return node === e.target || node.contains(e.target as Node)
        })
      ) {
        if (__DEV__) {
          debugMessage({
            type: 'event',
            module: '💊',
            color: '#e0407b',<commit_msg>docs: remove unnecessary param document<commit_after>import { KEY_EVENT_LISTENERS } from '../util/const'
import debugMessage from '../util/debug-message'
import check from '../util/check'

declare var __DEV__: boolean

/**
 * The decorator for registering event listener info to the method.
 * @param event The event name
 * @param at The selector
 */
const on: any = (event: string, { at }: { at?: string } = {}) => (
  target: any,
  key: string,
  _: any
) => {
  const constructor = target.constructor
  check(
    !!event,
    `Empty event handler is given: constructor=${constructor.name} key=${key}`
  )
  /**
   * @param el The element
   * @param coelem The coelement
   * @param name The component name
   */
  constructor[KEY_EVENT_LISTENERS] = (
    constructor[KEY_EVENT_LISTENERS] || []
  ).concat((el: HTMLElement, coelem: any, name: string) => {
    const keyEventListeners = KEY_EVENT_LISTENERS + name

    const listener = (e: Event): void => {
      if (
        !at ||
        [].some.call(el.querySelectorAll(at), (node: Node) => {
          return node === e.target || node.contains(e.target as Node)
        })
      ) {
        if (__DEV__) {
          debugMessage({
            type: 'event',
            module: '💊',
            color: '#e0407b',
{'fraction_non_alphanumeric': 0.14035769828926906, 'fraction_numerical': 0.003110419906687403, 'mean_word_length': 2.707492795389049, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '2057147', 'n_tokens_mistral': 784, 'n_tokens_neox': 780, 'n_words': 229}