2024-07-28 02:37:31 -04:00
|
|
|
const { processNbtMessage } = require('prismarine-chat')
|
|
|
|
const parse = function (data) {
|
|
|
|
if (typeof data.type === 'string') {
|
|
|
|
return JSON.parse(processNbtMessage(data))
|
|
|
|
} else if (typeof data === 'string') {
|
|
|
|
return JSON.parse(data)
|
|
|
|
} else {
|
|
|
|
return data
|
|
|
|
}
|
2024-07-27 02:39:18 -04:00
|
|
|
}
|
|
|
|
module.exports = parse
|