Skip to content

API Reference

Complete API documentation for JavaScript Utils functions.

Function Categories

Function Utils

  • debounce - Delay function execution until after wait time has elapsed
  • throttle - Limit function execution frequency
  • delay - Delay function execution

Array Utils

  • isArray - Check if value is an array
  • chunk - Split array into chunks of specified size
  • unique - Remove duplicates from array

Object Utils

  • deepCopy - Deep clone objects
  • pick - Pick specified properties from object
  • omit - Omit specified properties from object

String Utils

Validation Utils

Import Methods

typescript
import { debounce, throttle } from '@tofrankie/utils'

TypeScript Support

JavaScript Utils is built with TypeScript and provides complete type definitions:

typescript
import { debounce } from '@tofrankie/utils'

// TypeScript knows the exact type
const debouncedFn: (...args: any[]) => void = debounce(() => {
  console.log('Hello')
}, 300)

Bundle Size

Each function is optimized for minimal bundle size:

  • debounce: ~0.5KB
  • throttle: ~0.5KB
  • isArray: ~0.2KB
  • deepCopy: ~0.4KB
  • convert2pinyin: ~0.3KB

基于 MIT 许可发布