INNER CODE UNIT · JavaScript
isSimpleParameterList
standard-things/esm · .babel.config.js:66
function isSimpleParameterList(params) {
return params.every(({ type }) => type === "Identifier")
}
function enterFunction(path) {
const { node } = path
const { directives } = node.body
if (directives &&
isSimpleParameterList(node.params) &&
! isInMode(path)) {
directives.push(types.directive(types.directiveLiteral("use strict")))
}
}
return {
visitor: {
ArrowFunctionExpression: enterFunction,