{"id":42162,"library":"typelab","title":"typelab","description":"typelab v1.0.1 is a zero-dependency TypeScript library providing a suite of reusable, type-level utility types for everyday TypeScript development. Released under MIT license with active maintenance, it offers aliases (Primitive, Nullable), assertions (IsExtends, IsEqual, IsAny), conditional types (IfExtends, IfEqual, IfAny), and utility types (FunctionCallbackify, FunctionPromisify, ObjectAssign). Unlike similar libraries like type-fest or utility-types, typelab focuses purely on type-level operations with no runtime code, making it lightweight for dev dependencies. The package is ESM and CommonJS compatible, ships with TypeScript definitions, and has a simple, documented API.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/codeismyid/typelab","tags":["javascript","typescript","ts","utility-types","ts-utility-types","type-utilities","type-safety","advanced-types","type-helpers"],"install":[{"cmd":"npm install typelab","lang":"bash","label":"npm"},{"cmd":"yarn add typelab","lang":"bash","label":"yarn"},{"cmd":"pnpm add typelab","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Named export only; default import is not supported.","wrong":"import Primitive from 'typelab'","symbol":"Primitive","correct":"import { Primitive } from 'typelab'"},{"note":"CommonJS require is supported but not recommended; prefer ESM imports. The package exports only named members.","wrong":"const { IsExtends } = require('typelab')","symbol":"IsExtends","correct":"import { IsExtends } from 'typelab'"},{"note":"All types are exported from the main entry point; no subpath exports.","wrong":"import { ObjectAssign } from 'typelab/types'","symbol":"ObjectAssign","correct":"import { ObjectAssign } from 'typelab'"},{"note":"No subpath exports; all types are in the root module.","wrong":"import { IfAny } from 'typelab/conditions'","symbol":"IfAny","correct":"import { IfAny } from 'typelab'"},{"note":"All types are exported from the main package index.","wrong":"import { FunctionCallbackify } from 'typelab/utils'","symbol":"FunctionCallbackify","correct":"import { FunctionCallbackify } from 'typelab'"}],"quickstart":{"code":"import { IsExtends, IfExtends, Nullable, Primitive, ObjectAssign } from 'typelab';\n\n// Type-level checks\ntype Check1 = IsExtends<string, any>; // true\ntype Check2 = IsExtends<number, string>; // false\n\n// Conditional types\ntype Result = IfExtends<string, any, 'yes', 'no'>; // 'yes'\n\n// Nullable alias\ntype MaybeString = Nullable<string>; // string | null\n\n// Primitive alias\ntype P = Primitive; // string | number | boolean | symbol | bigint | null | undefined\n\n// Object merge\ntype Merged = ObjectAssign<{ a: number }, { b: string }>; // { a: number; b: string }","lang":"typescript","description":"Demonstrates importing and using several typelab utility types for type-level checks and object merging."},"warnings":[{"fix":"Explicitly union with undefined: Nullable<T> | undefined","message":"Nullable excludes undefined; use Nullable<T> | undefined for both null and undefined.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For non-distributive behavior, use IsEqual or IfEqual with exact types.","message":"IsExtends and IfExtends treat union types specially: for unions, the condition is distributed over each member.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Check release notes before upgrading.","message":"No breaking changes documented yet; API stable.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"N/A","message":"No deprecated APIs in current version.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'activ':30 'advanc':115 'advanced-typ':114 'alias':34 'api':97 'assert':37 'code':74 'commonj':86 'compat':87 'condit':41 'definit':91 'depend':8,80 'dev':79 'develop':24 'document':96 'esm':84 'everyday':22 'fest':58 'focus':64 'functioncallbackifi':49 'functionpromisifi':50 'helper':119 'ifani':45 'ifequ':44 'ifextend':43 'isani':40 'isequ':39 'isextend':38 'javascript':98 'level':18,69 'librari':10,54 'licens':28 'lightweight':77 'like':55 'mainten':31 'make':75 'mit':27 'nullabl':36 'objectassign':51 'offer':33 'oper':70 'packag':82 'primit':35 'provid':11 'pure':65 'releas':25 'reusabl':15 'runtim':73 'safeti':113 'ship':88 'similar':53 'simpl':95 'suit':13 'ts':100,105 'ts-utility-typ':104 'type':17,20,42,48,57,62,68,103,107,109,112,116,118 'type-fest':56 'type-help':117 'type-level':16,67 'type-safeti':111 'type-util':108 'typelab':1,2,63 'typescript':9,23,90,99 'unlik':52 'util':19,47,61,102,106,110 'utility-typ':60,101 'v1.0.1':3 'zero':7 'zero-depend':6","created_at":"2026-06-04T18:55:55.135023+00:00","updated_at":"2026-06-04T18:55:55.135023+00:00","problems":[{"fix":"Primitive includes string, number, etc. Ensure value is a primitive: const x: Primitive = 'hello';","cause":"Using Primitive as a type guard without ensuring all primitive types are covered.","error":"TS2322: Type 'string' is not assignable to type 'Primitive'."},{"fix":"Use Nullable<T> | undefined or cast: const x: Nullable<string> | undefined = null;","cause":"Nullable includes only null, not undefined. If the value can be undefined, use Nullable<T> | undefined.","error":"Type 'null' is not assignable to type 'Nullable<string>'."},{"fix":"Ensure the type is a function signature: type Fn = (a: number) => string; type Cb = FunctionCallbackify<Fn>;","cause":"Using FunctionCallbackify or FunctionPromisify on a non-function type.","error":"TS2344: Type 'T' does not satisfy the constraint '(...args: any[]) => any'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/codeismyid/typelab#readme","github":"https://github.com/codeismyid/typelab","docs":null,"changelog":null,"pypi":null,"npm":"typelab","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}