UNPKG
@eckidevs/payfastjs
Version:
latest (0.1.3)
0.1.3
0.1.2
0.1.1
0.1.0
A Node.js implementation of the PayFast API.
github.com/Eckhardt-D/payfastjs
Eckhardt-D/payfastjs
@eckidevs/payfastjs
/
src
/
utils
/
buildUriStringFromObject.js
12 lines
(10 loc)
•
246 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
module
.
exports
=
function
(
obj
) {
let
str =
""
;
let
objArr =
Object
.
keys
(obj); objArr.
forEach
(
(
key, index
) =>
{ str +=
`
${key}
=
${
encodeURIComponent
(obj[key])}
${ index == objArr.length -
1
?
""
:
"&"
}
`
; });
return
str; };