Last change
on this file was 47f4eaf, checked in by Marko <Marko@…>, 23 months ago |
Final features implemented
|
-
Property mode
set to
100644
|
File size:
466 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 |
|
---|
7 | /**
|
---|
8 | * Encode object to url parameters
|
---|
9 | *
|
---|
10 | * @param {Object} paramsObj The object needs to encode as url parameters
|
---|
11 | * @return {String} Encoded url parameters
|
---|
12 | */
|
---|
13 | exports.default = function (paramsObj) {
|
---|
14 | var str = '';
|
---|
15 | for (var key in paramsObj) {
|
---|
16 | if (str !== '') {
|
---|
17 | str += '&';
|
---|
18 | }
|
---|
19 | str += key + '=' + encodeURIComponent(paramsObj[key]);
|
---|
20 | }
|
---|
21 | return str;
|
---|
22 | }; |
---|
Note:
See
TracBrowser
for help on using the repository browser.