{"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,"search_vec":"'0.2.0':19 'altern':45 'broader':55 'code':44 'current':21 'differenti':31 'experiment':25 'fest':49 'filter':37 'generic':8,66 'infrequ':28 'javascript':65 'key':30 'lack':60 'level':17 'librari':6 'like':46 'manipul':11 'map':39 'may':59 'member':41 'offer':32 'oper':64 'packag':23 'provid':7,54 'runtim':43 'see':27 'specif':63 'transform':34 'type':9,16,33,48,53,56 'type-fest':47 'typescript':2,12,68 'typescript-union':1 'union':3,13,40,62,67 'union-specif':61 'updat':29 'util':5,52,57 'utility-typ':51 'version':18 'without':42","created_at":"2026-04-27T17:05:31.328244+00:00","updated_at":"2026-04-27T17:05:31.328244+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/ksxnodemodules/typescript-union","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/typescript-union","openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}