Skip to content

Commit

Permalink
move to secure-json-parse (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Sep 4, 2021
1 parent 72808da commit cf9c502
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const fs = require('fs')
const args = require('args')
const path = require('path')
const pump = require('pump')
const bourne = require('@hapi/bourne')
const sjp = require('secure-json-parse')
const JoyCon = require('joycon')
const stripJsonComments = require('strip-json-comments')

Expand All @@ -13,7 +13,7 @@ const CONSTANTS = require('./lib/constants')
const { isObject } = require('./lib/utils')

const parseJSON = input => {
return bourne.parse(stripJsonComments(input), { protoAction: 'remove' })
return sjp.parse(stripJsonComments(input), { protoAction: 'remove' })
}

const joycon = new JoyCon({
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { Transform } = require('readable-stream')
const abstractTransport = require('pino-abstract-transport')
const jmespath = require('jmespath')
const sonic = require('sonic-boom')
const bourne = require('@hapi/bourne')
const sjs = require('secure-json-parse')

const colors = require('./lib/colors')
const { ERROR_LIKE_KEYS, MESSAGE_KEY, TIMESTAMP_KEY } = require('./lib/constants')
Expand All @@ -23,7 +23,7 @@ const {

const jsonParser = input => {
try {
return { value: bourne.parse(input, { protoAction: 'remove' }) }
return { value: sjs.parse(input, { protoAction: 'remove' }) }
} catch (err) {
return { err }
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"test"
],
"dependencies": {
"@hapi/bourne": "^2.0.0",
"args": "^5.0.1",
"colorette": "^1.3.0",
"dateformat": "^4.5.1",
Expand All @@ -43,6 +42,7 @@
"pump": "^3.0.0",
"readable-stream": "^3.6.0",
"rfdc": "^1.3.0",
"secure-json-parse": "^2.4.0",
"sonic-boom": "^2.2.0",
"strip-json-comments": "^3.1.1"
},
Expand Down

0 comments on commit cf9c502

Please sign in to comment.