<commit_before>import * as IncrementalDOM from 'incremental-dom';
import * as skateSymbols from './symbols';
import { shadowDomV0, shadowDomV1 } from '../util/support';

// Could import these, but we have to import all of IncrementalDOM anyways so
// that we can export our configured IncrementalDOM.
const {
  applyProp,
  attr,
  attributes,
  elementClose,
  elementOpen,
  elementOpenEnd,
  elementOpenStart,
  skip,
  symbols,
  text
} = IncrementalDOM;

// Specify an environment for iDOM in case we haven't yet.
if (typeof process === 'undefined') {
  /* eslint no-undef: 0 */
  process = { env: { NODE_ENV: 'production' } };
}

const applyDefault = attributes[symbols.default];
const factories = {};

// Attributes that are not handled by Incremental DOM.
attributes.key = attributes.skip = attributes.statics = function () {};

// Attributes that *must* be set via a property on all elements.
attributes.checked = attributes.className = attributes.disabled = attributes.value = applyProp;

// Default attribute applicator.
attributes[symbols.default] = function (elem, name, value) {
  // Boolean false values should not set attributes at all.
  if (value === false) {
    return;
  }

  // Custom element properties should be set as properties.
  const props = elem.constructor.props;
  if (props && name in props) {
    return applyProp(elem, name, value);
  }

  // Handle built-in and custom events.
  if (name.indexOf('on') === 0) {
    return name in elem ? applyProp(elem, name, value) : applyEvent(elem, name.substring(2), name, value);
  }

  // Fallback to default IncrementalDOM behaviour.<commit_msg>fix(vdom): Remove node env setting for incremental DOM. This shouldn't be necessary anyomre and some<commit_after>import * as IncrementalDOM from 'incremental-dom';
import * as skateSymbols from './symbols';
import { shadowDomV0, shadowDomV1 } from '../util/support';

// Could import these, but we have to import all of IncrementalDOM anyways so
// that we can export our configured IncrementalDOM.
const {
  applyProp,
  attr,
  attributes,
  elementClose,
  elementOpen,
  elementOpenEnd,
  elementOpenStart,
  skip,
  symbols,
  text
} = IncrementalDOM;

const applyDefault = attributes[symbols.default];
const factories = {};

// Attributes that are not handled by Incremental DOM.
attributes.key = attributes.skip = attributes.statics = function () {};

// Attributes that *must* be set via a property on all elements.
attributes.checked = attributes.className = attributes.disabled = attributes.value = applyProp;

// Default attribute applicator.
attributes[symbols.default] = function (elem, name, value) {
  // Boolean false values should not set attributes at all.
  if (value === false) {
    return;
  }

  // Custom element properties should be set as properties.
  const props = elem.constructor.props;
  if (props && name in props) {
    return applyProp(elem, name, value);
  }

  // Handle built-in and custom events.
  if (name.indexOf('on') === 0) {
    return name in elem ? applyProp(elem, name, value) : applyEvent(elem, name.substring(2), name, value);
  }

  // Fallback to default IncrementalDOM behaviour.
{'fraction_non_alphanumeric': 0.1091024421186172, 'fraction_numerical': 0.0028544243577545195, 'mean_word_length': 3.859784283513097, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3776607', 'n_tokens_mistral': 916, 'n_tokens_neox': 887, 'n_words': 324}