You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

formats.js 521B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. var replace = String.prototype.replace;
  3. var percentTwenties = /%20/g;
  4. var util = require('./utils');
  5. var Format = {
  6. RFC1738: 'RFC1738',
  7. RFC3986: 'RFC3986'
  8. };
  9. module.exports = util.assign(
  10. {
  11. 'default': Format.RFC3986,
  12. formatters: {
  13. RFC1738: function (value) {
  14. return replace.call(value, percentTwenties, '+');
  15. },
  16. RFC3986: function (value) {
  17. return String(value);
  18. }
  19. }
  20. },
  21. Format
  22. );