{"library":"typed-function","type":"library","category":null,"description":"typed-function (current stable version 4.2.2) is a JavaScript utility library designed to centralize and manage runtime type checking and automatic type conversion for function arguments. It allows developers to define multiple signatures for a single function, supporting union types, the `any` type, and variable arguments. This approach helps in separating type validation logic from core business logic, leading to cleaner code and more informative error messages when functions are called with incorrect input. The library aims to improve robustness and debuggability in JavaScript applications by providing consistent and helpful error messages, preventing silent failures due to invalid inputs. It is actively maintained and supports various environments, including Node.js (>=18) and modern browsers. Its key differentiators include flexible signature definition, detailed error reporting, and optional type conversion.","language":"javascript","status":"active","version":"4.2.2","tags":["javascript","typed","function","arguments","compose","types"],"last_verified":"Wed May 27","install":[{"cmd":"npm install typed-function","imports":["import typed from 'typed-function'","const typed = require('typed-function')","typed.addType({ name: 'MyType', test: (x) => x instanceof MyClass })"]},{"cmd":"yarn add typed-function","imports":[]},{"cmd":"pnpm add typed-function","imports":[]}],"homepage":null,"github":"https://github.com/josdejong/typed-function","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/typed-function","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/typed-function/compatibility"}}