main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
548 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | import utils from '../utils.js';
|
---|
4 | import toFormData from './toFormData.js';
|
---|
5 | import platform from '../platform/index.js';
|
---|
6 |
|
---|
7 | export default function toURLEncodedForm(data, options) {
|
---|
8 | return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
|
---|
9 | visitor: function(value, key, path, helpers) {
|
---|
10 | if (platform.isNode && utils.isBuffer(value)) {
|
---|
11 | this.append(key, value.toString('base64'));
|
---|
12 | return false;
|
---|
13 | }
|
---|
14 |
|
---|
15 | return helpers.defaultVisitor.apply(this, arguments);
|
---|
16 | }
|
---|
17 | }, options));
|
---|
18 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.