code: function (value, options) {                                                              // 141
    options = options || {};                                                                                           // 142
                                                                                                                       // 143
    if ( value === null ) return "null";                                                                               // 144
                                                                                                                       // 145
    if ( options.onlyShowType ) {                                                                                      // 146
      return typeof value;                                                                                             // 147
    }                                                                                                                  // 148
                                                                                                                       // 149
    // Your average non-object things.  Saves from doing the try/catch below for.                                      // 150
    if ( typeof value !== "object" ) {                                                                                 // 151
      return EJSON.stringify(value)                                                                                    // 152
    }                                                                                                                  // 153
                                                                                                                       // 154
    try {                                                                                                              // 155
      // Find objects with circular references since EJSON doesn't support them yet (Issue #4778 + Unaccepted PR)      // 156
      // If the native stringify is going to choke, EJSON.stringify is going to choke too.                             // 157
      JSON.stringify(value);                                                                                           // 158
    } catch (stringifyError) {                                                                                         // 159
      if ( stringifyError.name === "TypeError" ) {                                                                     // 160
        return typeof value;                                                                                           // 161
      }                                                                                                                // 162
    }                                                                                                                  // 163
                                                                                                                       // 164
    return EJSON.stringify(value);                                                                                     // 165
  }
docs: 139 140