json-ascii
Advanced tools
Comparing version 3.2.0 to 3.3.0
@@ -54,6 +54,4 @@ 'use strict' | ||
str: "Zm9v", | ||
bar: { | ||
baz: "baz" | ||
}, | ||
array: ['foo', 'bar'], | ||
array: "WyJmb28iLCJiYXIiXQ==", | ||
bar: "eyJiYXoiOiJiYXoifQ==", | ||
untouched: 123 | ||
@@ -60,0 +58,0 @@ }, encodedObject) |
@@ -15,3 +15,3 @@ 'use strict' | ||
const type = _.get(fieldListConfiguration[field], 'type') | ||
if(type && _.find(['object', 'array'], type)) { | ||
if(type && _.includes(['object', 'array'], type)) { | ||
returnObject[field] = Buffer.from(JSON.stringify(returnObject[field])).toString('base64') | ||
@@ -28,10 +28,10 @@ } | ||
_.each(_.keys(fieldListConfiguration), (field) => { | ||
if (_.isString(returnObject[field])) { | ||
const type = _.get(fieldListConfiguration[field], 'type') | ||
if (type && _.includes(['object', 'array'], type)) { | ||
const jsonString = Buffer.from(returnObject[field], 'base64').toString('utf-8') | ||
returnObject[field] = JSON.parse(jsonString) | ||
} else if (_.isString(returnObject[field])) { | ||
returnObject[field] = Buffer.from(returnObject[field], 'base64').toString('utf-8') | ||
} else if (_.isObject(returnObject[field]) || _.isArray(returnObject[field])) { | ||
const type = _.get(fieldListConfiguration[field], 'type') | ||
if(type && _.find(['object', 'array'], type)) { | ||
returnObject[field] = JSON.parse(Buffer.from(returnObject[field], 'base64').toString('utf-8')) | ||
} | ||
} | ||
}) | ||
@@ -38,0 +38,0 @@ |
{ | ||
"name": "json-ascii", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"description": "encodes and decodes utf8 four byte characters", | ||
@@ -5,0 +5,0 @@ "main": "json-ascii.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9044
227