Files
vue-cli/packages/@vue/cli/lib/util/stringifyJS.js
Haoqun Jiang c76d2e691d style: add a "no-shadow" linter rule (#4385)
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.
2019-08-02 18:24:52 +08:00

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)
}