index.js
function getOptions(options) {
    var opts = {
      include: [
        {
          chars: [[0x0000, 0xFFFF]],
          min: 0
        }
      ],
      exclude: []
    };

    // Merge the properties of our options
    for (var property in options) {
      // Ignore options that are not in our opts set or are not an array
      if (!opts.hasOwnProperty(property) || !Array.isArray(options[property])) {
        continue;
      }

      // Reset the default value for this property since it's being overridden
      if (property === 'include') {
        opts.include = [];
      }

      // Merge the options given
      for (var set in options[property]) {
        if (typeof options[property][set] === 'object' &&
          options[property][set].hasOwnProperty('chars') &&
          Array.isArray(options[property][set].chars)
        ) {
          // Add the character set to the options
          var charSet = {
            chars: options[property][set].chars,
            min: 0
          };

          // Set the minimum value if given
          if (options[property][set].hasOwnProperty('min') &&
            isInt(options[property][set].min) &&
            options[property][set].min > 0
          ) {
            charSet.min = options[property][set].min;
          }

          opts[property].push(charSet);
        }
      }
    }

    return opts;
  }
function getOptions(options) {
    var opts = {
      include: [
        {
          chars: [[0x0000, 0xFFFF]],
          min: 0
        }
      ],
      exclude: []
    };

    // Merge the properties of our options
    for (var property in options) {
      // Ignore options that are not in our opts set or are not an array
      if (!opts.hasOwnProperty(property) || !Array.isArray(options[property])) {
        continue;
      }

      // Reset the default value for this property since it's being overridden
      if (property === 'include') {
        opts.include = [];
      }

      // Merge the options given
      for (var set in options[property]) {
        if (typeof options[property][set] === 'object' &&
          options[property][set].hasOwnProperty('chars') &&
          Array.isArray(options[property][set].chars)
        ) {
          // Add the character set to the options
          var charSet = {
            chars: options[property][set].chars,
            min: 0
          };

          // Set the minimum value if given
          if (options[property][set].hasOwnProperty('min') &&
            isInt(options[property][set].min) &&
            options[property][set].min > 0
          ) {
            charSet.min = options[property][set].min;
          }

          opts[property].push(charSet);
        }
      }
    }

    return opts;
  }
function getOptions ( options ) { var opts = { include : [ { chars : [ [ 0x0000 , 0xFFFF ] ] , min : 0 } ] , exclude : [ ] } ; // Merge the properties of our options for ( var property in options ) { // Ignore options that are not in our opts set or are not an array if ( ! opts . hasOwnProperty ( property ) || ! Array . isArray ( options [ property ] ) ) { continue ; } // Reset the default value for this property since it's being overridden if ( property === 'include' ) { opts . include = [ ] ; } // Merge the options given for ( var set in options [ property ] ) { if ( typeof options [ property ] [ set ] === 'object' && options [ property ] [ set ] . hasOwnProperty ( 'chars' ) && Array . isArray ( options [ property ] [ set ] . chars ) ) { // Add the character set to the options var charSet = { chars : options [ property ] [ set ] . chars , min : 0 } ; // Set the minimum value if given if ( options [ property ] [ set ] . hasOwnProperty ( 'min' ) && isInt ( options [ property ] [ set ] . min ) && options [ property ] [ set ] . min > 0 ) { charSet . min = options [ property ] [ set ] . min ; } opts [ property ] . push ( charSet ) ; } } } return opts ; }
Creates a set of options for the generator from the given options

@param {Object} options An Object containing:
- include (optional) - An Object containing an Array of Objects, each of which contain:
- chars - An Array containing an Array of 1 character per index:
- 0 - A single character, hex character, or unicode character.
This may be a single character to include, or the beginning of a
range of characters to include
- 1 - A single character, hex character, or unicode character.
This must be the end of the range of the characters to include.
- min (optional) - An Integer representing the minimum number of
characters from the 'chars' set that *must* be included in the generated
string
- exclude (optional) - An Object containing an Array of Objects, each of which contain:
- chars - An Array containing an Array of 1 character per index:
- 0 - A single character, hex character, or unicode character.
This may be a single character to exclude, or the beginning of a
range of characters to exclude
- 1 - A single character, hex character, or unicode character.
This must be the end of the range of the characters to exclude.
@returns {Object} An Object representing the given options
Creates a set of options for the generator from the given options