Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json-ascii

Package Overview
Dependencies
Maintainers
4
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-ascii - npm Package Compare versions

Comparing version 3.2.0 to 3.3.0

6

__test__/object-property-base64-encoder-test.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc