Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove eval to allow execution without unsafe-eval CSP #46

Open
wants to merge 1 commit into
base: latest
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions lib/toml-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,7 @@ function isList (obj) {
return obj[_type] === LIST
}

// in an eval, to let bundlers not slurp in a util proxy
let _custom
try {
const utilInspect = eval("require('util').inspect")
_custom = utilInspect.custom
} catch (_) {
/* eval require not available in transpiled bundle */
}
/* istanbul ignore next */
const _inspect = _custom || 'inspect'
const _inspect = 'inspect'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://nodejs.org/api/util.html#util_util_inspect_custom

Suggested change
const _inspect = 'inspect'
const _inspect = Symbol.for('nodejs.util.inspect.custom')


class BoxedBigInt {
constructor (value) {
Expand Down