code: function($input) {
          var type = $input.attr('type'),
              val = $input.val();
  
          // Is this an unchecked checkbox or radio button?
          if ((type === 'checkbox' || type === 'radio')) {
              if ($input.prop('checked')) {
                  return val;
              }
              else {
                  return null;
              }
          }
  
          // Flatten any array values whose input name doesn't end in "[]"
          //  - e.g. a multi-select
          else if (Garnish.isArray(val) && $input.attr('name').substr(-2) !== '[]') {
              if (val.length) {
                  return val[val.length - 1];
              }
              else {
                  return null;
              }
          }
  
          // Just return the value
          else {
              return val;
          }
      }
docs: Returns an input's value as it would be POSTed.
  So unchecked checkboxes and radio buttons return null,
  and multi-selects whose name don't end in "[]" only return the last selection
  
  @param {object} $input
  @return {(string|string[])}