All files / lib formats.js

100% Statements 6/6
100% Branches 0/0
100% Functions 2/2
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24    1x 1x   1x         1x       8x     1130x            
'use strict';
 
var replace = String.prototype.replace;
var percentTwenties = /%20/g;
 
var Format = {
    RFC1738: 'RFC1738',
    RFC3986: 'RFC3986'
};
 
module.exports = {
    'default': Format.RFC3986,
    formatters: {
        RFC1738: function (value) {
            return replace.call(value, percentTwenties, '+');
        },
        RFC3986: function (value) {
            return String(value);
        }
    },
    RFC1738: Format.RFC1738,
    RFC3986: Format.RFC3986
};