This package has been deprecated

Author message:

typelogic deprecated in favour of more comprehensive typelevel-ts library

typelogic
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

TypeLogic

Type definitions for performing powerful and unholy generic type logic in TypeScript

Install

npm install typelogic --save-dev

Usage

Referencing the typings

There are two ways to consume these typings.

  1. (Preferred method) Add path to typings in your tsconfig.json file

    e.g. Assuming your tsconfig.json lives in your package root directory, add a path like so:

    {
      "files": [
        "./node_modules/typelogic/index.d.ts",
        ...
      ]
    }
  2. Or add a reference to typings in your consuming code.

    e.g. Assuming you have an foo.ts in your package root folder, add a path like so:

    /// <reference path="./node_modules/typelogic/index.d.ts" />
     
    ...

DO NOT attempt to import the types using an import/require statement like below or TypeScript will no likely. Everything might seem okay at first, but later logic will not work as expected, just trust me.

Using the typings

Okay, if you've referenced the typings correctly, you'll now have access to the following types:

  • True
  • False
  • Bool
  • If<TCondition, TThen, TElse>

What you do with them is up to you. Examples to come.

Issues or suggestions?

Please create an issue or pull request here. 😸

Package Sidebar

Install

npm i typelogic

Weekly Downloads

2

Version

2.0.0

License

MIT

Unpacked Size

2.64 kB

Total Files

5

Last publish

Collaborators

  • codeandcats