API Reference
Welcome to the xfunc API reference documentation. xfunc is a collection of utility functions designed for TypeScript/JavaScript.
Quick Navigation
Array Methods
Utility methods for array processing
toArray- Convert value to array
Function Methods
Utility methods for function processing
debounce- Create debounced functionthrottle- Create throttled function
Number Methods
Utility methods for number processing
toNumber- Convert value to numberrandomInt- Generate random integer in range
Object Methods
Utility methods for object processing
forOwn- Iterate over own object propertieshasOwn- Check for own propertyclone- Create shallow clonecloneDeep- Create deep clonemerge- Deep merge objectsomit/omitBy- Create object excluding specified propertiespick/pickBy- Create object with only specified propertiesmapEntries- Transform object key-value pairs through mapping functionforEachEntry- Iterate over object key-value pairs
String Methods
Utility methods for string processing
capitalize- Capitalize first character, lowercase restlowerFirst- Convert first character to lowercaseupperFirst- Convert first character to uppercasecamelize- Convert hyphenated string to camelCasehyphenate- Convert camelCase string to hyphenated
Type Check Methods
Utility methods for type checking
- Contains 21 type checking functions like
isString,isNumber,isBoolean, etc.
Usage
ts
// Import specific functions
import { debounce, toNumber } from 'xfunc'
// Or import all methods
import * as xfunc from 'xfunc'Overview
xfunc provides a comprehensive set of utility functions that are:
- Type-safe: Built with TypeScript for excellent IntelliSense
- Tree-shakable: Import only what you need
- Zero dependencies: Lightweight and self-contained
- Well-tested: Comprehensive test coverage
- Production-ready: Used in real-world applications
All functions follow consistent naming conventions and provide reliable error handling.