function isOuterVariableInDestructing(name, initScope) {
	if (
		initScope.through.some(
			ref => ref.resolved && ref.resolved.name === name,
		)
	) {
		return true;
	}

	const variable = astUtils.getVariableByName(initScope, name);

	if (variable !== null) {
		return variable.defs.some(def => def.type === "Parameter");
	}

	return false;
}
Checks if an property or element is from outer scope or function parameters
in destructing pattern.
@param {string} name A variable name to be checked.
@param {eslint-scope.Scope} initScope A scope to start find.
@returns {boolean} Indicates if the variable is from outer scope or function parameters.