xhrSimpleDataSerializer.js.flow 469 B

12345678910111213141516171819
  1. /**
  2. * Copyright (c) 2013-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @providesModule xhrSimpleDataSerializer
  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;