{"id":14996,"library":"typescript-logic","title":"TypeScript Type-Level Logic Utilities","description":"This package provides experimental type-level boolean logic primitives using TypeScript's advanced generic system. With a version of `0.0.0` and last published over seven years ago (September 2018), it is in an extremely early, experimental state and is effectively abandoned. There is no established release cadence, and it completely lacks documentation, including a README. Its intended purpose is for advanced TypeScript developers requiring compile-time type validation or metaprogramming, allowing for boolean operations such as AND, OR, and NOT to be performed directly within the type system. This enables the creation of more robust and self-documenting types for intricate conditional logic scenarios, distinguishing itself by offering these utilities as pure type definitions rather than runtime values.","status":"abandoned","version":"0.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/ksxnodemodules/typescript-logic","tags":["javascript","logic","generic","typescript","boolean","true","false"],"install":[{"cmd":"npm install typescript-logic","lang":"bash","label":"npm"},{"cmd":"yarn add typescript-logic","lang":"bash","label":"yarn"},{"cmd":"pnpm add typescript-logic","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Type-level constant for 'true'. Always use 'import type' and remember it's a type, not a runtime value.","wrong":"import { True } from 'typescript-logic';\nconst val: True = true;","symbol":"True","correct":"import type { True } from 'typescript-logic';"},{"note":"Type-level constant for 'false'. Use 'import type' as it's a type-only construct.","wrong":"import { False } from 'typescript-logic';\nconst val: False = false;","symbol":"False","correct":"import type { False } from 'typescript-logic';"},{"note":"Imports the type-level AND operator. This is a type, not a CommonJS module or runtime value.","wrong":"const And = require('typescript-logic').And;","symbol":"And","correct":"import type { And } from 'typescript-logic';"},{"note":"Imports the type-level OR operator. This package is TypeScript type-only.","symbol":"Or","correct":"import type { Or } from 'typescript-logic';"},{"note":"Imports the type-level NOT operator. Designed for compile-time logic.","symbol":"Not","correct":"import type { Not } from 'typescript-logic';"}],"quickstart":{"code":"import type { True, False, And, Or, Not } from 'typescript-logic';\n\n// Define some type-level boolean variables\ntype IsLoggedIn = True;\ntype HasAdminPermissions = False;\ntype IsPremiumUser = True;\n\n// Demonstrate type-level AND logic\ntype CanAccessAdminPanel = And<IsLoggedIn, HasAdminPermissions>;\n// Expected: False\n\n// Demonstrate type-level OR logic\ntype CanViewPremiumContent = Or<IsPremiumUser, HasAdminPermissions>;\n// Expected: True\n\n// Demonstrate type-level NOT logic\ntype IsGuest = Not<IsLoggedIn>;\n// Expected: False\n\n// Combine operations\ntype CanPerformCriticalAction = And<IsLoggedIn, Or<HasAdminPermissions, IsPremiumUser>>;\n// Expected: And<True, Or<False, True>> -> And<True, True> -> True\n\n// Verify the results (compile-time assertion)\ntype Test1 = CanAccessAdminPanel extends False ? true : false;\nconst test1Result: Test1 = true;\n\ntype Test2 = CanViewPremiumContent extends True ? true : false;\nconst test2Result: Test2 = true;\n\ntype Test3 = IsGuest extends False ? true : false;\nconst test3Result: Test3 = true;\n\ntype Test4 = CanPerformCriticalAction extends True ? true : false;\nconst test4Result: Test4 = true;","lang":"typescript","description":"Demonstrates basic type-level boolean logic operations (AND, OR, NOT) using generic types."},"warnings":[{"fix":"Avoid using this package for new projects or production. Consider type-level utility libraries that are actively maintained and have stable versioning.","message":"The package is at version `0.0.0` and was last published over seven years ago. It is highly unstable, experimental, and should not be used in production environments. Significant breaking changes are likely with any future TypeScript version updates, as it relies on internal type system behaviors.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Always use `import type { SymbolName } from 'typescript-logic';` to correctly import type-level constructs.","message":"This package is entirely type-level. It provides no runtime JavaScript values or functions. Attempting to `require()` or `import` symbols without the `type` keyword will result in runtime errors or incorrect bundling.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Thoroughly inspect the source code or rely on TypeScript's built-in type inference to understand available generics and their proper application.","message":"The package lacks any official documentation (no README), making its usage, API, and specific behaviors difficult to ascertain without direct code inspection.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Change `import { And } from 'typescript-logic';` to `import type { And } from 'typescript-logic';`.","cause":"Attempting to import a type-level generic without the 'import type' syntax or referring to it as a runtime value.","error":"Cannot find name 'And'."},{"fix":"Ensure you are using the specific type-level constants (`True`, `False`) provided by the library when constructing generic types, rather than raw `true` or `false` boolean literals.","cause":"Confusing runtime boolean values (`true`, `false`) with their type-level literal counterparts (`True`, `False`).","error":"Type 'boolean' is not assignable to type 'True'."}],"ecosystem":"npm"}