Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/babel-utils/babel-flow-scope
[Deprecated] Use babel-utils/babel-type-scopes for both Flow & TypeScript support
https://github.com/babel-utils/babel-flow-scope
babel babel-flow babel-util flow flowtype
Last synced: about 3 hours ago
JSON representation
[Deprecated] Use babel-utils/babel-type-scopes for both Flow & TypeScript support
- Host: GitHub
- URL: https://github.com/babel-utils/babel-flow-scope
- Owner: babel-utils
- License: mit
- Created: 2017-06-01T23:53:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-05T06:59:56.000Z (about 7 years ago)
- Last Synced: 2024-10-31T14:43:12.586Z (7 days ago)
- Topics: babel, babel-flow, babel-util, flow, flowtype
- Language: JavaScript
- Homepage:
- Size: 26.4 KB
- Stars: 7
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# babel-flow-scope
> Collect [Flow](https://flow.org/) bindings in a given scope
```js
import type foo from "mod";
type baz = {};
``````js
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.