npm package: @rickyzz/arrays_bolt2025
Description: A comprehensive TypeScript utility library for array operations with React components for demonstration.
Latest version: 1.0.0

# @rickyzz/arrays_bolt2025

A comprehensive TypeScript utility library for array operations with React components for demonstration.

## Features

- 🚀 Type-safe array operations
- 💪 Robust string handling
- 🎯 2D array support
- ⚛️ React demo component included
- 📦 Zero dependencies (except React for demo component)
- 🔒 TypeScript support out of the box

## Installation

```bash
npm install @rickyzz/arrays_bolt2025
```

## Usage

### Array Operations

```typescript
import { 
  isNotEmpty, 
  uniqueAndConvertToArray, 
  lastElement,
  lastRecords,
  clean
} from '@rickyzz/arrays_bolt2025';

// Check if array is not empty
const hasItems = isNotEmpty(['a', 'b', 'c']); // true

// Get unique values
const unique = uniqueAndConvertToArray(['a', 'a', 'b']); // ['a', 'b']

// Get last element
const last = lastElement(['a', 'b', 'c']); // 'c'

// Get last N records
const lastTwo = lastRecords(['a', 'b', 'c'], 2); // ['b', 'c']

// Clean array (remove empty elements and duplicates)
const cleaned = clean(['a', '', 'a', 'b']); // ['a', 'b']
```

### 2D Array Operations

```typescript
import { sort2dArray, isTwoDimensionalArray } from '@rickyzz/arrays_bolt2025';

const data = [
  ['banana', '2'],
  ['apple', '1'],
  ['cherry', '3']
];

// Sort 2D array by first column
const sorted = sort2dArray(data); // Sorts alphabetically by first column

// Check if array is 2D
const is2D = isTwoDimensionalArray(data); // true
```

### String Operations

```typescript
import { contains, toLowerCaseUnbreakable } from '@rickyzz/arrays_bolt2025';

// Case-insensitive string contains
const hasText = contains('HELLO', 'hello world'); // true

// Safe lowercase conversion
const lower = toLowerCaseUnbreakable('Hello'); // 'hello'
```

### React Demo Component

```typescript
import { ArrayUtilsDemo } from '@rickyzz/arrays_bolt2025';

function App() {
  return (
    <ArrayUtilsDemo 
      initialArray="apple banana cherry"
      initial2DArray={[
        ['apple', '1'],
        ['banana', '2'],
        ['cherry', '3']
      ]}
    />
  );
}
```

## API Reference

### Array Functions

- `isInArrayCaseInsensitive(item: string, arr?: string[]): boolean`
- `isNotEmpty(arr: unknown[]): boolean`
- `isTwoDimensionalArray(arr: unknown[]): boolean`
- `stringToArray(str: string | string[]): string[]`
- `arrayToString(arr: string | string[]): string`
- `uniqueAndConvertToArray<T>(arr: T[]): T[]`
- `lastElement<T>(arr: T[]): T`
- `lastRecords<T>(arr: T[] | undefined, num: number): T[]`
- `removeEmptyElements<T>(arr: T[] | undefined): T[]`
- `clean<T>(arr: T[]): T[]`
- `remove<T>(arr: T[], value: T): T[]`
- `sort2dArray(arr: TwoDArray, column?: number, direction?: 'asc' | 'desc'): TwoDArray`

### String Functions

- `toLowerCaseUnbreakable(str: string): string`
- `trimUnbreakable(str: string): string`
- `contains(needle: string, haystack: string): boolean`

### React Components

#### ArrayUtilsDemo

Props:
- `className?: string` - Additional CSS classes
- `initialArray?: string` - Initial array for demonstration
- `initial2DArray?: string[][]` - Initial 2D array for demonstration

## License

MIT

## Author

rickyzz