Skip to content
This repository was archived by the owner on Aug 20, 2018. It is now read-only.

Commit fa5464b

Browse files
committed
Merge pull request #8 from keanification/master
making sure source is string before parsing
2 parents 81d49ab + ea70470 commit fa5464b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
module.exports = function(source) {
66
this.cacheable && this.cacheable();
7-
var value = JSON.parse(source);
7+
var value = typeof source === "string" ? JSON.parse(source) : source;
88
this.value = [value];
9-
return "module.exports = " + JSON.stringify(value, undefined, "\t");
9+
return "module.exports = " + JSON.stringify(value, undefined, "\t") + ";";
1010
}

0 commit comments

Comments
 (0)