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.3.4 to 3.3.5

15

__test__/json-ascii-test.js

@@ -94,2 +94,17 @@ 'use strict'

})
it('an object encoded using object-property-base64-ecoder is untouched by this library', () => {
const jsonObject = {
str: 'Zm9v',
array: 'WyJmb28iLCJiYXIiXQ==',
bar: 'eyJiYXoiOiJiYXoifQ==',
untouched: 123,
base64EncoderConfig: {
str: {}
}
}
const backFromString = JSONAscii.parseWithDecode(JSON.stringify(jsonObject), true)
assertObjectEqual(jsonObject, backFromString)
})
})

@@ -91,2 +91,17 @@ 'use strict'

})
it('when working with kinesis analytics this gets turned into a string parse it and use it in that case', () => {
const objectToDecode = {
canonicalMessageJson: 'eyJ0ZXh0IjoiTVx1MDAxYVxuJiN4NjIxMTsifQ==',
base64EncoderConfig: '{"text":{},"messageJson":{"type":"object"},"canonicalMessageJson":{"type":"object"},' +
'"metadata":{"type":"object"}}'
}
const decodedObject = objectPropertyEncoder.decode(objectToDecode)
assertObjectEqual({
canonicalMessageJson: {
'text': 'M\u001a\n我'
}
}, decodedObject)
})
})

6

object-property-base64-encoder.js

@@ -26,6 +26,10 @@ 'use strict'

decode(object, encoderConfiguraiton) {
const fieldListConfiguration = encoderConfiguraiton || object.base64EncoderConfig
let fieldListConfiguration = encoderConfiguraiton || object.base64EncoderConfig
if (!fieldListConfiguration) {
return object
}
if (_.isString(fieldListConfiguration)) {
fieldListConfiguration = JSON.parse(fieldListConfiguration)
}
const returnObject = _.clone(object)

@@ -32,0 +36,0 @@

2

package.json
{
"name": "json-ascii",
"version": "3.3.4",
"version": "3.3.5",
"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