New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

yatts-typescript

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yatts-typescript

Keep your typescript version synchronized with a patched version that exposes internal definitions and some private methods for type checking.

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

yatts-typescript

Keep your typescript version synchronized with a patched version that exposes internal definitions and some private methods for type checking.

How does it work?

When you run pnpm yatts-typescript-sync, it will look for your installed version of typescript, make a copy in its own location, apply the patches and re-export the patched version. So you can import yatts-typescript and enjoy your patched version of typescript while keeping your original version intact.

What does it add/remove?

  • Removes all @internal tags which allows you to access internal types, classes, properties and methods with their declarations.

  • Export some very useful private methods from the TypeChecker:

    function isTypeSubtypeOf(source: Type, target: Type): boolean;
    function isTypeIdenticalTo(source: Type, target: Type): boolean;
    function isTypeDerivedFrom(source: Type, target: Type): boolean;
    function isTypeAssignableTo(source: Type, target: Type): boolean;
    function isTypeComparableTo(source: Type, target: Type): boolean;
    function areTypesComparable(source: Type, target: Type): boolean;
    

Installation

pnpm add typescript yatts-typescript

Keep yatts-typescript in sync with each installation/update of typescript

Add an postinstall or prepare field in your package.json with pnpm yatts-typescript-sync in it.

{
  "postinstall": "pnpm yatts-typescript-sync"
}

Usage

import ts from 'yatts-typescript';

// Use ts as usual.

Programmatic API

import { patch } from 'yatts-typescript/patch';

const { error, success, modulePath } = patch(options);

Options

  • typescriptModuleId: string | undefined - Default to typescript.
  • outputDirectory: string | undefined - Default to node_modules/yatts-typescript/lib.
  • patchRules: [PatchRule, ...PatchRule[]] | undefined - Default to undefined.
  • additionalPatchRules: PatchRule[] | undefined - Default to undefined.

Alternatives

yatts-typescript is a combination of the alternatives listed below. But instead of maintaining an up-to-date build of typescript we use your locally installed version.

Remove @internal tags

  • byots Bring your own TypeScript with more internal definitions
  • ts-expose-internals Expose TypeScript internal types by simply adding a development dependency

Expose TypeChecker methods

Remove @internal tags and expose TypeChecker methods

  • unleashed-typescript TypeScript with exposed internal definitions and some private methods for type checking.

Scaffolded with @skarab/skaffold

Keywords

typescript

FAQs

Package last updated on 02 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts