From ac5c75c924960ab4c264557e2136ac252f8c3ce7 Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 26 Apr 2022 18:45:36 +0200 Subject: [PATCH 1/2] Handle nodes when parsing plist --- lib/parse.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/parse.js b/lib/parse.js index 807c4ae..734ad1f 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -212,6 +212,9 @@ function parsePlistXML (node) { ) return new Date(node.childNodes[0].nodeValue); + } else if (node.nodeName === 'null') { + return null; + } else if (node.nodeName === 'true') { return true; From 6f931a098bd2b914d1762962dde0ed8e60842908 Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 26 Apr 2022 19:08:02 +0200 Subject: [PATCH 2/2] Fix test --- test/parse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parse.js b/test/parse.js index 7aa81f3..4df67b4 100644 --- a/test/parse.js +++ b/test/parse.js @@ -19,7 +19,7 @@ describe('parse()', function () { describe('null', function () { it('should parse a node into a null value', function () { var parsed = parseFixture(''); - assert.strictEqual(parsed, undefined); + assert.strictEqual(parsed, null); }); });