From d61b9c3efc8d3fa73ca3a779977af74c5ca055ec Mon Sep 17 00:00:00 2001 From: Avaq Date: Thu, 24 Mar 2016 16:25:53 +0100 Subject: [PATCH] Feedback round 1 * Rename parameter from "json" to "s" * Lowecase "Type" * Proper JSON without the spaces --- index.js | 2 +- test/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index a25b82e8..c01c388f 100644 --- a/index.js +++ b/index.js @@ -2764,7 +2764,7 @@ def('parseJson', {}, [TypeRep, $.String, $Maybe(a)], - function(type, json) { return filter(is(type), encase(JSON.parse, json)); }); + function(type, s) { return filter(is(type), encase(JSON.parse, s)); }); //. ### RegExp diff --git a/test/index.js b/test/index.js index 570f01ee..166fcf5a 100644 --- a/test/index.js +++ b/test/index.js @@ -4149,8 +4149,8 @@ describe('parse', function() { eq(S.parseJson(Object, '[Invalid JSON]'), S.Nothing()); }); - it('returns a Nothing when the parsed result is not a member of the given Type', function() { - eq(S.parseJson(Array, '{"foo": "bar"}'), S.Nothing()); + it('returns a Nothing when the parsed result is not a member of the given type', function() { + eq(S.parseJson(Array, '{"foo":"bar"}'), S.Nothing()); }); });