Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ayecue/miniscript-type-analyzer
https://github.com/ayecue/miniscript-type-analyzer
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ayecue/miniscript-type-analyzer
- Owner: ayecue
- Created: 2024-06-08T19:15:09.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-12-14T13:59:24.000Z (about 1 month ago)
- Last Synced: 2024-12-14T14:01:40.816Z (about 1 month ago)
- Language: TypeScript
- Size: 5.29 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# miniscript-type-analyzer
[![miniscript-type-analyzer](https://circleci.com/gh/ayecue/miniscript-type-analyzer.svg?style=svg)](https://circleci.com/gh/ayecue/miniscript-type-analyzer)
Analyzes MiniScript and suggests types. Recommended to be used with [greybel-core](https://github.com/ayecue/greybel-core) even though it should be also able to digest [miniscript-core](https://github.com/ayecue/miniscript-core) AST.
## Example
```ts
import { miniscriptMeta } from 'miniscript-meta';
import { Parser } from 'greybel-core';const typeManager = new TypeManager({
container: greyscriptMeta
});
const parser = new Parser(content, {
unsafe: true
});
const chunk = parser.parseChunk();typeManager.analyze(document.uri, chunk);
const allIdentifier = typeManager.getRootScopeContext().scope.getAllIdentifier();
console.log(`Your code includes: ${allIdentifier.size}`);
```