@schroffl/json-mapping
Advanced tools
Comparing version
@@ -61,8 +61,13 @@ // The export pattern is a UMD template: | ||
function toDebugString(value) { | ||
var str = '\n' + JSON.stringify(value, null, 4); | ||
return str.replace(/\n/g, '\n ') + '\n'; | ||
} | ||
function expected(type, value) { | ||
return 'Expected ' + type + ', but got ' + JSON.stringify(value, null, 4); | ||
return 'Expected ' + type + ', but got\n' + toDebugString(value); | ||
} | ||
function decode(decoder, value) { | ||
var result = decodeInternal(decoder, value); | ||
var result = decodeInternal(decoder, value, value); | ||
@@ -69,0 +74,0 @@ if (isOk(result)) { |
{ | ||
"name": "@schroffl/json-mapping", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "A set of utilites for defining and running conversions between JSON and JavaScript values", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
9323
1.64%240
1.69%