1 | ;
|
2 |
|
3 | exports.__esModule = true;
|
4 |
|
5 | const { getScope } = require('./contextCompat');
|
6 |
|
7 | /** @type {import('./declaredScope').default} */
|
8 | exports.default = function declaredScope(context, name, node) {
|
9 | const references = (node ? getScope(context, node) : context.getScope()).references;
|
10 | const reference = references.find((x) => x.identifier.name === name);
|
11 | if (!reference || !reference.resolved) { return undefined; }
|
12 | return reference.resolved.scope.type;
|
13 | };
|