miniscript-type-analyzer
v0.20.4
Published
[![miniscript-type-analyzer](https://circleci.com/gh/ayecue/miniscript-type-analyzer.svg?style=svg)](https://circleci.com/gh/ayecue/miniscript-type-analyzer)
Downloads
637
Readme
miniscript-type-analyzer
Analyzes MiniScript and suggests types. Recommended to be used with greybel-core even though it should be also able to digest miniscript-core AST.
Example
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.getAvailableIdentifier();
console.log(`Your code includes: ${allIdentifier.size}`);