@arcblock/forge-message
Advanced tools
Comparing version 1.0.33 to 1.1.0
@@ -19,10 +19,3 @@ /* eslint-disable consistent-return */ | ||
const { toBN, bytesToHex, isUint8Array, toUint8Array } = require('@arcblock/forge-util'); | ||
const { | ||
enums, | ||
messages, | ||
getMessageType, | ||
toTypeUrl, | ||
fromTypeUrl, | ||
addProvider, | ||
} = require('./provider'); | ||
const { enums, messages, getMessageType, toTypeUrl, fromTypeUrl, addProvider } = require('./provider'); | ||
// eslint-disable-next-line | ||
@@ -405,3 +398,3 @@ const debug = require('debug')(`${require('../package.json').name}`); | ||
const { typeUrl, value } = data; | ||
if (typeUrl === 'json') { | ||
if (['json', 'vc'].includes(typeUrl)) { | ||
return { type: typeUrl, value: JSON.parse(Buffer.from(value, 'base64')) }; | ||
@@ -442,3 +435,3 @@ } | ||
anyMessage.setValue(data.value); | ||
} else if (data.typeUrl === 'json') { | ||
} else if (['json', 'vc'].includes(data.typeUrl)) { | ||
anyMessage.setValue(Uint8Array.from(Buffer.from(JSON.stringify(data.value)))); | ||
@@ -445,0 +438,0 @@ } else { |
{ | ||
"name": "@arcblock/forge-message", | ||
"description": "Utility functions to encode and decode message that can send to forge", | ||
"version": "1.0.33", | ||
"version": "1.1.0", | ||
"author": { | ||
@@ -75,3 +75,3 @@ "name": "wangshijun", | ||
}, | ||
"gitHead": "52680b5630465c937b6a133503597fb7b5ef9e29" | ||
"gitHead": "5ce499658bd16915c25c54999d9ef8716305d1b8" | ||
} |
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
32946
978