docs: function factory(options) {
      assert.optionalObject(options, 'options');
  
      var opts = _.assign({
          topLevelFields: false
      }, options);
  
      var serializer = new ErrorSerializer(opts);
      // rebind the serialize function since this will be lost when we export it
      // as a POJO
      serializer.serialize = serializer.serialize.bind(serializer);
  
      return serializer;
  }