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

/**
 * Convenience subtype of Property that constrains values to be true or false.
 * Truthy/falsy values are considered invalid.
 *
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME> (PixelZoom, Inc.)
 */
define( function( require ) {
  'use strict';

  // modules
  var axon = require( 'AXON/axon' );
  var BooleanIO = require( 'TANDEM/types/BooleanIO' );
  var inherit = require( 'PHET_CORE/inherit' );
  var Property = require( 'AXON/Property' );
  var PropertyIO = require( 'AXON/PropertyIO' );

  /**
   * @param {boolean} value - initial value
   * @param {Object} [options]
   * @constructor
   */
  function BooleanProperty( value, options ) {

    options = options || {};

    assert && assert( !options.isValidValue, 'isValidValue is not supported by BooleanProperty' );
    assert && assert( !options.validValues, 'validValues is not supported by BooleanProperty' );
    assert && assert( !options.valueType, 'valueType is set by BooleanProperty' );
    options.valueType = 'boolean';  // BooleanProperty requires values to be primitive booleans

    assert && assert( !options.hasOwnProperty( 'phetioType' ), 'phetioType is set by BooleanProperty' );
    options.phetioType = PropertyIO( BooleanIO );

    Property.call( this, value, options );
  }

  axon.register( 'BooleanProperty', BooleanProperty );

  return inherit( Property, BooleanProperty );
} );<commit_msg>Factored out reusable PropertyIO type, see https://github.com/phetsims/unit-rates/issues/207<commit_after>// Copyright 2016-2018, University of Colorado Boulder

/**
 * Convenience subtype of Property that constrains values to be true or false.
 * Truthy/falsy values are considered invalid.
 *
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME> (PixelZoom, Inc.)
 */
define( function( require ) {
  'use strict';

  // modules
  var axon = require( 'AXON/axon' );
  var BooleanIO = require( 'TANDEM/types/BooleanIO' );
  var inherit = require( 'PHET_CORE/inherit' );
  var Property = require( 'AXON/Property' );
  var PropertyIO = require( 'AXON/PropertyIO' );

  // constants
  var BooleanPropertyIO = PropertyIO( BooleanIO );

  /**
   * @param {boolean} value - initial value
   * @param {Object} [options]
   * @constructor
   */
  function BooleanProperty( value, options ) {

    options = options || {};

    assert && assert( !options.isValidValue, 'isValidValue is not supported by BooleanProperty' );
    assert && assert( !options.validValues, 'validValues is not supported by BooleanProperty' );
    assert && assert( !options.valueType, 'valueType is set by BooleanProperty' );
    options.valueType = 'boolean';  // BooleanProperty requires values to be primitive booleans

    assert && assert( !options.hasOwnProperty( 'phetioType' ), 'phetioType is set by BooleanProperty' );
    options.phetioType = BooleanPropertyIO;

    Property.call( this, value, options );
  }

  axon.register( 'BooleanProperty', BooleanProperty );

  return inherit( Property, BooleanProperty );
} );
{'fraction_non_alphanumeric': 0.12272727272727273, 'fraction_numerical': 0.006168831168831169, 'mean_word_length': 3.9854368932038833, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, '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': '2186360', 'n_tokens_mistral': 914, 'n_tokens_neox': 873, 'n_words': 274}