xhrSimpleDataSerializer.js 441 B

1234567891011121314151617181920
  1. 'use strict';
  2. /**
  3. * Copyright (c) 2013-present, Facebook, Inc.
  4. *
  5. * This source code is licensed under the MIT license found in the
  6. * LICENSE file in the root directory of this source tree.
  7. *
  8. */
  9. function xhrSimpleDataSerializer(data) {
  10. var uri = [];
  11. var key;
  12. for (key in data) {
  13. uri.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key]));
  14. }
  15. return uri.join('&');
  16. }
  17. module.exports = xhrSimpleDataSerializer;