ts-bigint-transform-jsbi
TypeScript icon, indicating that this package has built-in type declarations

0.6.3 • Public • Published

ts-bigint-transform-jsbi

How To Use

import { CompileFactory } from "ts-bigint-transform-jsbi";
import * as ts from "typescript";

const compile = CompileFactory({
  IMPORT_HEADER: `const JSBI = require('jsbi');\nconst BigInt = JSBI.BigInt;\n`
});
compile(process.argv.slice(2), {
  noEmitOnError: true,
  noImplicitAny: true,
  target: ts.ScriptTarget.ESNext,
  module: ts.ModuleKind.CommonJS,
  outDir: "./build"
});

Custom Compile

you can get an transformer to transform code when emit program. and get the transform count in every source file.

import { TransformerFactory } from "ts-bigint-transform-jsbi";
const { transformer, bigintTransformCount } = TransformerFactory(
  (<ts.Program>program).getTypeChecker(),
  { JSBI_GLOBAL_SYMBOL_NAME: "JSBI" }
);

const c: WeakMap<ts.SourceFile, number> = bigintTransformCount;
const t: ts.TransformerFactory<ts.SourceFile> = transformer;

Readme

Keywords

none

Package Sidebar

Install

npm i ts-bigint-transform-jsbi

Weekly Downloads

32

Version

0.6.3

License

none

Unpacked Size

22.8 kB

Total Files

8

Last publish

Collaborators

  • kezhaofeng