lib/serializer.js
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;
}
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;
}
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 ; }
factory function to create customized serializers.
@public
@param {Object} options an options object
@return {Function} serializer function
factory function to create customized serializers .