mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-14 03:11:19 -06:00
It has become a common source of mistakes. For example, during PR #4363 I've referred to the wrong `options` several times due to the variable shadowing.
11 lines
303 B
JavaScript
11 lines
303 B
JavaScript
module.exports = function stringifyJS (value) {
|
|
const stringify = require('javascript-stringify')
|
|
// eslint-disable-next-line no-shadow
|
|
return stringify(value, (val, indent, stringify) => {
|
|
if (val && val.__expression) {
|
|
return val.__expression
|
|
}
|
|
return stringify(val)
|
|
}, 2)
|
|
}
|