babel-flow-scope

1.2.1 • Public • Published

babel-flow-scope

Collect Flow bindings in a given scope

import type foo from "mod";
type baz<bar> = {};
import {getFlowBindingsInScope} from 'babel-flow-scope';
 
getFlowBindingsInScope(path);
// {
//   foo: {
//     kind: 'import',
//     path: (Identifier)
//   },
//   bar: {
//     kind: 'param',
//     path: (TypeParameter)
//   },
//   baz: {
//     kind: 'declaration',
//     path: (Identifier)
//   }
// }

API

getFlowScopePath(path)

Find the closest path to a Flow scope.

getFlowBindingsInScope(path)

Retreive all the Flow bindings in the local Flow scope.

findFlowBinding(path, name)

Search for a binding in the current scope and parent scopes.

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i babel-flow-scope

    Weekly Downloads

    399

    Version

    1.2.1

    License

    MIT

    Last publish

    Collaborators

    • thejameskyle