{"id":22504,"library":"typescript-union","title":"typescript-union","description":"A utility library providing generic types for manipulating TypeScript unions at the type level. Version 0.2.0 is current; the package is experimental and sees infrequent updates. Key differentiators: offers type transformations such as filtering and mapping union members without runtime code. Alternatives like type-fest or utility-types provide broader type utilities but may lack union-specific operations.","status":"deprecated","version":"0.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/ksxnodemodules/typescript-union","tags":["javascript","generic","union","typescript"],"install":[{"cmd":"npm install typescript-union","lang":"bash","label":"npm"},{"cmd":"yarn add typescript-union","lang":"bash","label":"yarn"},{"cmd":"pnpm add typescript-union","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Used in type context only; no runtime export.","symbol":"Filter","correct":"import { Filter } from 'typescript-union'"},{"note":"ESM-only; avoid CommonJS require.","wrong":"const { Split } = require('typescript-union')","symbol":"Split","correct":"import { Split } from 'typescript-union'"},{"note":"Exported as named type.","symbol":"UnionToIntersection","correct":"import { UnionToIntersection } from 'typescript-union'"}],"quickstart":{"code":"import { Filter, UnionToIntersection } from 'typescript-union';\n\ntype Mixed = string | number | boolean;\ntype OnlyStrings = Filter<Mixed, string>; // string\n\ntype Funcs = ((x: string) => void) | ((x: number) => void);\ntype Intersected = UnionToIntersection<Funcs>; // (x: string & number) => void\n","lang":"typescript","description":"Demonstrates Filter and UnionToIntersection type utilities for union transformations."},"warnings":[{"fix":"Consider alternatives like type-fest or ts-essentials.","message":"Package is abandoned; no updates since 2020.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Use import type syntax: import type { Filter } from 'typescript-union'.","message":"All exports are types only; importing at runtime will cause errors.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Replace deprecated aliases with the new names per changelog.","message":"Removal of deprecated type aliases in version 0.2.0.","severity":"breaking","affected_versions":">=0.2.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install: npm install typescript-union --save-dev","cause":"Package not installed or missing type definitions.","error":"Cannot find module 'typescript-union' or its corresponding type declarations."},{"fix":"Remove from runtime code or use import type.","cause":"Runtime usage of a type-only export.","error":"'Filter' cannot be used as a value because it is a type."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}