{"id":18879,"library":"typescript-treasure","title":"TypeScript Treasure","description":"A collection of TypeScript type utilities inspired by a coding style called MuGuaTS. Provides generic tools like If_Num, If_Str, If_Bool, If_Arr, If_Obj, If_Nul, If_Und, If_Never, If_Any, If_Unknown, If_Union, If_Equal, If_Includes, If_Some, If_Every, If_Key, If_Val, If_Readonly, If_Optional, If_Required, If_Mutable, If_Writable, If_Fn, If_Tuple, etc. Current stable version 0.0.12. Release cadence is infrequent; appears to be a side project. Differentiators: opinionated naming convention and one-line/multi-line formatting rules aimed at readability.","status":"active","version":"0.0.12","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript","typescript-treasure","ts","tools","types","typesafe"],"install":[{"cmd":"npm install typescript-treasure","lang":"bash","label":"npm"},{"cmd":"yarn add typescript-treasure","lang":"bash","label":"yarn"},{"cmd":"pnpm add typescript-treasure","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Import from 'typescript-treasure'. Use named import.","wrong":"const { If_Num } = require('typescript-treasure')","symbol":"If_Num","correct":"import { If_Num } from 'typescript-treasure'"},{"note":"Default export is not provided; use named import.","wrong":"import If_Str from 'typescript-treasure'","symbol":"If_Str","correct":"import { If_Str } from 'typescript-treasure'"},{"note":"Function name uses underscore: If_Equal, not IfEqual.","wrong":"import { IfEqual } from 'typescript-treasure'","symbol":"If_Equal","correct":"import { If_Equal } from 'typescript-treasure'"},{"note":"Named import; all utility types start with If_.","wrong":"","symbol":"If_Bool","correct":"import { If_Bool } from 'typescript-treasure'"},{"note":"Named import.","wrong":"","symbol":"If_Arr","correct":"import { If_Arr } from 'typescript-treasure'"}],"quickstart":{"code":"import { If_Num, If_Str, If_Bool, If_Equal, If_Includes } from 'typescript-treasure';\n\ntype Test1 = If_Num<42>; // true\ntype Test2 = If_Str<'hello'>; // true\ntype Test3 = If_Bool<false>; // true\ntype Test4 = If_Equal<1, 2>; // false\ntype Test5 = If_Includes<[1, 2, 3], 2>; // true","lang":"typescript","description":"Demonstrates usage of several type utilities: If_Num, If_Str, If_Bool, If_Equal, If_Includes with example types."},"warnings":[{"fix":"Use correct names like 'If_Num', 'If_Str'.","message":"All utility types are prefixed with 'If_' and use underscores after 'If'. Incorrect casing (e.g., 'IfNum') will cause type errors.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Use import destructuring and ensure bundler supports tree shaking (e.g., ES modules).","message":"Package is not tree-shakeable in all bundlers due to possible barrel exports; importing unused utilities may increase bundle size in some setups.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Refer to inline type comments or experiment with the utilities directly.","message":"Documentation is primarily in Chinese; English docs may be incomplete or missing.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install typescript-treasure' and ensure 'typescript-treasure' is in node_modules types.","cause":"Package not installed or not in tsconfig paths.","error":"Cannot find module 'typescript-treasure' or its corresponding type declarations."},{"fix":"Use import { If_Num } from 'typescript-treasure'.","cause":"Typo or using default import instead of named.","error":"'If_Num' is not exported from 'typescript-treasure'."},{"fix":"Use If_Num<42> extends true ? ... : ... pattern.","cause":"If_Num returns a type (true/false), not a runtime value.","error":"Type 'If_Num<42>' is not assignable to type 'boolean'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}