kiruthiga 55473b7e7c initial push 5 zile în urmă
..
typeguard 55473b7e7c initial push 5 zile în urmă
util 55473b7e7c initial push 5 zile în urmă
.editorconfig 55473b7e7c initial push 5 zile în urmă
.fimbullinter.yaml 55473b7e7c initial push 5 zile în urmă
.wotanrc.yaml 55473b7e7c initial push 5 zile în urmă
CHANGELOG.md 55473b7e7c initial push 5 zile în urmă
LICENSE 55473b7e7c initial push 5 zile în urmă
README.md 55473b7e7c initial push 5 zile în urmă
index.d.ts 55473b7e7c initial push 5 zile în urmă
index.js 55473b7e7c initial push 5 zile în urmă
package.json 55473b7e7c initial push 5 zile în urmă

README.md

Utility functions for working with typescript's AST

Greenkeeper badge

Usage

This package consists of two major parts: utilities and typeguard functions. By importing the project you will get both of them.

import * as utils from "tsutils";
utils.isIdentifier(node); // typeguard
utils.getLineRanges(sourceFile); // utilities

If you don't need everything offered by this package, you can select what should be imported. The parts that are not imported are never read from disk and may save some startup time and reduce memory consumtion.

If you only need typeguards you can explicitly import them:

import { isIdentifier } from "tsutils/typeguard";
// You can even distiguish between typeguards for nodes and types
import { isUnionTypeNode } from "tsutils/typeguard/node";
import { isUnionType } from "tsutils/typeguard/type";

If you only need the utilities you can also explicitly import them:

import { forEachComment, forEachToken } from "tsutils/util";

Typescript version dependency

This package is backwards compatible with typescript 2.1.0 at runtime although compiling might need a newer version of typescript installed.

Using typescript@next might work, but it's not officially supported. If you encounter any bugs, please open an issue.