docs: function serializeInternal(obj, refs, stack) {
    var type = typeof obj, sign = '', className, value, ref;
  
    // Return up front on
    if (1 / obj === -Infinity) {
      sign = '-';
    }
  
    // Return quickly for primitives to save cycles
    if (isPrimitive(obj, type) && !isRealNaN(obj)) {
      return type + sign + obj;
    }
  
    className = classToString(obj);
  
    if (!isSerializable(obj, className)) {
      ref = indexOf(refs, obj);
      if (ref === -1) {
        ref = refs.length;
        refs.push(obj);
      }
      return ref;
    } else if (isObjectType(obj)) {
      value = serializeDeep(obj, refs, stack) + obj.toString();
    } else if (obj.valueOf) {
      value = obj.valueOf();
    }
    return type + className + sign + value;
  }