UNPKG
jws
Version:
latest (4.0.1)
4.0.1
4.0.0
3.2.3
3.2.2
3.2.1
3.2.0
3.1.5
3.1.4
3.1.3
3.1.2
3.1.1
3.1.0
3.0.0
2.0.0
1.0.1
1.0.0
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.0.2
0.0.1
Implementation of JSON Web Signatures
github.com/brianloveswords/node-jws
brianloveswords/node-jws
jws
/
lib
/
tostring.js
11 lines
(9 loc)
•
262 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
/*global module*/
var
Buffer
=
require
(
'buffer'
).
Buffer
;
module
.
exports
=
function
toString
(
obj
) {
if
(
typeof
obj ===
'string'
)
return
obj;
if
(
typeof
obj ===
'number'
||
Buffer
.
isBuffer
(obj))
return
obj.
toString
();
return
JSON
.
stringify
(obj); };