<commit_before>// Copyright 2018, University of Colorado Boulder

/**
 * "definition" type for a "Type" that a value can be validated against.
 * TypeDef accepts multiple ways to test
 * @author <NAME> <<EMAIL>>
 */

define( require => {
  'use strict';

  const ObjectIO = require( 'TANDEM/types/ObjectIO' );
  const axon = require( 'AXON/axon' );

  const TypeDef = {
    /**
     * Returns whether the parameter is considered to be a TypeDef.
     * @public
     *
     * @param {*} type
     * @returns {boolean}
     */
    isTypeDef( type ) {
      if ( typeof type === 'function' ) {
        if ( type.isPredicate || !type.name ) { // TODO: are these the best criteria?
          return typeof type() === 'boolean'; // should return a boolean is a predicate function
        }

        // Here we are assuming that whatever the type is will be tested with `instanceof`,
        // though there is no way to check if a function is constructable since not all phet constructors use
        // `class`, see https://stackoverflow.com/a/40922715
        return true;<commit_msg>remove type.name check, no support on IE11, #189<commit_after>// Copyright 2018, University of Colorado Boulder

/**
 * "definition" type for a "Type" that a value can be validated against.
 * TypeDef accepts multiple ways to test
 * @author <NAME> <<EMAIL>>
 */

define( require => {
  'use strict';

  const ObjectIO = require( 'TANDEM/types/ObjectIO' );
  const axon = require( 'AXON/axon' );

  const TypeDef = {
    /**
     * Returns whether the parameter is considered to be a TypeDef.
     * @public
     *
     * @param {*} type
     * @returns {boolean}
     */
    isTypeDef( type ) {
      if ( typeof type === 'function' ) {
        if ( type.isPredicate ) { // TODO: are these the best criteria? Function.name ISN'T SUPPORTED ON IE11
          return typeof type() === 'boolean'; // should return a boolean is a predicate function
        }

        // Here we are assuming that whatever the type is will be tested with `instanceof`,
        // though there is no way to check if a function is constructable since not all phet constructors use
        // `class`, see https://stackoverflow.com/a/40922715
        return true;
{'fraction_non_alphanumeric': 0.11086074808472285, 'fraction_numerical': 0.013970256872465074, 'mean_word_length': 2.5691318327974275, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '3163442', 'n_tokens_mistral': 653, 'n_tokens_neox': 610, 'n_words': 252}