From 04b8a16882d8b39c15df834ce161fa9b637c1948 Mon Sep 17 00:00:00 2001 From: Charlie Date: Fri, 13 Apr 2018 15:56:21 +0100 Subject: [PATCH] Update nrc-serializer-manager: Fixes #190 nrc-serializer-manager.js:125:4 -> ReferenceError: xmlSerializer is not defined --- lib/nrc-serializer-manager.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/nrc-serializer-manager.js b/lib/nrc-serializer-manager.js index 9707802..f5b868b 100644 --- a/lib/nrc-serializer-manager.js +++ b/lib/nrc-serializer-manager.js @@ -113,13 +113,15 @@ var BaseSerializer ={ } }; +// Create serializer +var xmlSerializer = new xmlserializer.Builder(this.options) //add default serializer managers: JSON,XML and unknown content/type serializerManager.add(Object.assign({ "name":"XML", "options":{}, "contentTypes":["application/xml","application/xml;charset=utf-8","text/xml","text/xml;charset=utf-8"], - "xmlSerializer":new xmlserializer.Builder(this.options), + "xmlSerializer": xmlSerializer, "serialize":function(data,nrcEventEmitter,serializedCallback){ if (typeof data === 'object') data = xmlSerializer.buildObject(data); @@ -182,4 +184,4 @@ serializerManager.add({ return serializerManager; -}; \ No newline at end of file +};