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

/**
 * Convenience subtype of Property that constrains values to be a string.
 *
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME> (PixelZoom, Inc.)
 */
define( function( require ) {
  'use strict';

  // modules
  var axon = require( 'AXON/axon' );
  var inherit = require( 'PHET_CORE/inherit' );
  var Property = require( 'AXON/Property' );

  // phet-io modules
  var TString = require( 'ifphetio!PHET_IO/types/TString' );

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

    options = options || {};

    assert && assert( !options.phetioValueType, 'phetioValueType is set by StringProperty' );
    options.phetioValueType = TString;

    if ( options.validValues ) {
      assert && assert( _.every( options.validValues, function( value ) { return isString( value ); } ),
        'validValues must be strings' );
    }

    if ( options.isValidValue ) {

      // Wrap the provided function so that we can verify that the value is a string.
      // This prevents the client from having to check (or remember to check) that the value is a string.
      var isValidValue = options.isValidValue;<commit_msg>Simplified _.every argument, see https://github.com/phetsims/axon/issues/156<commit_after>// Copyright 2016-2017, University of Colorado Boulder

/**
 * Convenience subtype of Property that constrains values to be a string.
 *
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME> (PixelZoom, Inc.)
 */
define( function( require ) {
  'use strict';

  // modules
  var axon = require( 'AXON/axon' );
  var inherit = require( 'PHET_CORE/inherit' );
  var Property = require( 'AXON/Property' );

  // phet-io modules
  var TString = require( 'ifphetio!PHET_IO/types/TString' );

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

    options = options || {};

    assert && assert( !options.phetioValueType, 'phetioValueType is set by StringProperty' );
    options.phetioValueType = TString;

    if ( options.validValues ) {
      assert && assert( _.every( options.validValues, isString ), 'validValues must be strings' );
    }

    if ( options.isValidValue ) {

      // Wrap the provided function so that we can verify that the value is a string.
      // This prevents the client from having to check (or remember to check) that the value is a string.
      var isValidValue = options.isValidValue;
{'fraction_non_alphanumeric': 0.11726508785332315, 'fraction_numerical': 0.007257448433919022, 'mean_word_length': 3.244732576985413, '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': '1161756', 'n_tokens_mistral': 807, 'n_tokens_neox': 765, 'n_words': 257}