diff --git a/index.js b/index.js index 1b2c110..bc54883 100644 --- a/index.js +++ b/index.js @@ -42,7 +42,13 @@ ArrayParser.prototype.newEntry = function (includeEmpty) { if (entry === 'NULL' && !includeEmpty) { entry = null } - if (entry !== null) entry = this.transform(entry) + if (entry === 'true') { + entry = true + } + if (entry === 'false') { + entry = false + } + if (entry !== null && typeof entry !== 'boolean') entry = this.transform(entry) this.entries.push(entry) this.recorded = [] } diff --git a/test.js b/test.js index 6512e00..fed4253 100644 --- a/test.js +++ b/test.js @@ -10,6 +10,7 @@ test(function (t) { t.deepEqual(string('{""}'), [''], 'empty string') t.deepEqual(string('{1,2,3}'), ['1', '2', '3'], 'numerics') t.deepEqual(string('{a,b,c}'), ['a', 'b', 'c'], 'strings') + t.deepEqual(string('{true,false,true}'), [true, false, true], 'booleans') t.deepEqual(string('{"\\"\\"\\"","\\\\\\\\\\\\"}'), ['"""', '\\\\\\'], 'escaped') t.deepEqual(string('{NULL,NULL}'), [null, null], 'null')