open-index/open-npm huggingface dataset:
npm package: @rt-tools/core
Description: Core utilities for Angular applications - MessageBus, PlatformService, WINDOW token, and helper functions
Author: Yauheni Krumin
Latest version: 0.0.2

# @rt-tools/core

Core utilities for Angular applications.

## Installation

```bash
npm install @rt-tools/core
# or
pnpm add @rt-tools/core
```

## Features

### isNil
Type guard function for null/undefined checks.

```typescript
import { isNil } from '@rt-tools/core';

if (isNil(value)) {
    // value is null or undefined
}
```

### MessageBus
Event bus for component communication using RxJS.

```typescript
import { MessageBus } from '@rt-tools/core';

const bus = new MessageBus<'USER_LOGGED_IN' | 'USER_LOGGED_OUT'>();

// Subscribe to events
bus.ofType('USER_LOGGED_IN').subscribe(event => {
    console.log('User logged in');
});

// Emit events
bus.emit({ type: 'USER_LOGGED_IN' });
```

### PlatformService
Service for detecting browser/server platform.

```typescript
import { PlatformService } from '@rt-tools/core';

@Component({...})
export class MyComponent {
    private platform = inject(PlatformService);

    ngOnInit() {
        if (this.platform.isPlatformBrowser) {
            // Browser-only code
        }
    }
}
```

### WINDOW Token
Injection token for safe window access.

```typescript
import { WINDOW } from '@rt-tools/core';

@Component({...})
export class MyComponent {
    private window = inject(WINDOW);

    scrollToTop() {
        this.window.scrollTo(0, 0);
    }
}
```

## Requirements

- Angular 21+
- RxJS 7.8+

## License

Apache-2.0
npm package: @rt-tools/store
Description: Signal-based state management for Angular with Redux DevTools support
Author: Yauheni Krumin
Latest version: 0.0.4

# @rt-tools/store

Signal-based state management for Angular with Redux DevTools support.

## Installation

```bash
npm install @rt-tools/store @rt-tools/core
# or
pnpm add @rt-tools/store @rt-tools/core
```

## Features

### BaseStoreService

Synchronous state management with Angular Signals.

```typescript
import { Injectable } from '@angular/core';
import { BaseStoreService, IStoreConfig } from '@rt-tools/store';

interface CounterState {
    count: number;
}

type CounterAction = 'INCREMENT' | 'DECREMENT';

@Injectable({ providedIn: 'root' })
export class CounterStore extends BaseStoreService<CounterState, CounterAction> {
    constructor() {
        super({ count: 0 }, { name: 'CounterStore', devTools: true });
    }

    increment(): void {
        this.patchState(state => ({ ...state, count: state.count + 1 }), 'increment');
    }

    decrement(): void {
        this.patchState(state => ({ ...state, count: state.count - 1 }), 'decrement');
    }
}
```

### BaseAsyncStoreService

Extended store for async operations with loading states.

```typescript
import { Injectable } from '@angular/core';
import { BaseAsyncStoreService, BASE_INITIAL_STATE, IStateBase } from '@rt-tools/store';

interface UsersState extends IStateBase.Async {
    users: User[];
}

const INITIAL_STATE: UsersState = {
    ...BASE_INITIAL_STATE.ASYNC,
    users: [],
};

@Injectable({ providedIn: 'root' })
export class UsersStore extends BaseAsyncStoreService<UsersState, string> {
    constructor() {
        super(INITIAL_STATE, { name: 'UsersStore', devTools: true });
    }

    loadUsers(): void {
        this.startLoading();
        this.http.get<User[]>('/api/users').pipe(
            tap(users => {
                this.patchState(s => ({ ...s, users }), 'setUsers');
                this.setLoadingSuccess();
            }),
            catchError(error => this.setLoadingFailure(error))
        ).subscribe();
    }
}
```

### Selectors

```typescript
// In component
readonly loading = this.store.loading;
readonly users = computed(() => this.store.store().users);

// Template
@if (loading()) {
    <spinner />
} @else {
    @for (user of users(); track user.id) {
        <user-card [user]="user" />
    }
}
```

### Redux DevTools

Enable DevTools in config:

```typescript
super(INITIAL_STATE, {
    name: 'MyStore',
    devTools: true  // or { maxAge: 100, trace: true }
});
```

## Requirements

- Angular 21+
- @rt-tools/core ^0.0.1
- RxJS 7.8+

## License

Apache-2.0
npm package: @rt-tools/ui-kit
Description: Package uses Angular Signals (Angular 16+).
Author: Yauheni Krumin
Latest version: 0.0.12

# Set of utility types and functions for TypeScript
Package uses Angular Signals (Angular 16+).

## Interfaces & Types

* ```typescript
  IDictionary
    ```
* ```typescript
  IntersectionType
    ```
* ```typescript
  Modify
  ```
* ```typescript
  IMapper
  ```
* ```typescript
  Nullable
  ```
* ```typescript
  PartialOmit
  ```
* ```typescript
  Primitive
  ```
* Makes selected props from a record optional
```typescript
  Optional
  ```
* Get the union type of all the values in an object, array or array-like type
```typescript
  ValuesType
  ```


## Functions


* ```typescript
  isDateValid(date?: Date): boolean;
  ```
* ```typescript
  dateStringToDate(date: string | Date): Date;
  ```
* Indicates if the arguments are equal
```typescript
  isEqual<T>(f: T, s: T): boolean;
  ```
* Indicates if the content of two arrays is identical
```typescript
  areArraysEqual<T>(f: T[], s: T[]): boolean;
  ```
* Indicates if the content of two arrays is identical
```typescript
  areObjectsEqual<T>(f: T, s: T): boolean;
  ```
* ```typescript
  isNumber<T>(value: T | number | unknown | undefined): value is number;
  ```
* ```typescript
  initToday(): Date;
  ```
* ```typescript
  isToday(date: Date): boolean;
  ```
* Make shallow copy of passed object 
```typescript
  removeFieldFromObject<T extends object, K extends string>(obj: T, key: K): Omit<T, K>;
  ``` 
* Allow to compare two values by provided comparator
```typescript
  safeCompare<T>(a: T, b: T, comparator: ComparatorType<T>): number;
  ```
* Allow to safely compare two string values
```typescript
  safeStrCompare(a: string, b: string): number;
  ```
* Allow to safely compare two number values
```typescript
  safeNumCompare(a: number, b: number): number;
  ```
* Allow composing comparison chain of several comparators
that delegate comparison by the chain to the next comparators if current comparator returns 0 
```typescript
  safeComparatorPipe(...comparators: Array<() => number>): number;
  ```
* ```typescript
  sortByAlphabet: <T extends object>(a: T, b: T, field: keyof T) => number;
  ```
* ```typescript
  sortByDate: (a: { [field: string]: any }, b: { [field: string]: any }, field: string) => number
  ```
* ```typescript
  stringifyHttpLikeParams<T extends {}>(params: T): { [param: string]: string | string[] }
  ```
* ```typescript
  transformArrayInput<T>(array: unknown): T[]
  ```
npm package: @rt-tools/utils
Description: Utility functions, pipes, directives, validators and services for Angular applications
Author: RT Team
Latest version: 0.0.5

# @rt-tools/utils

Utility functions, pipes, directives, validators and services for Angular applications.

## Installation

```bash
npm install @rt-tools/utils @rt-tools/core
# or
pnpm add @rt-tools/utils @rt-tools/core
```

## Features

### Functions

```typescript
import { isEqual, isEmpty, isString, isNumber, debounce } from '@rt-tools/utils';

// Check equality
isEqual(obj1, obj2);

// Check if value is empty
isEmpty(value);

// Type guards
isString(value);
isNumber(value);

// Debounce function calls
const debouncedFn = debounce(() => { /* ... */ }, 300);
```

### Pipes

```typescript
import { BreakStringPipe, SanitizePipe, EqualPipe, TernaryPipe } from '@rt-tools/utils';

@Component({
    imports: [BreakStringPipe, SanitizePipe, EqualPipe, TernaryPipe],
    template: `
        {{ 'camelCaseString' | breakString }}
        {{ htmlContent | sanitize }}
        {{ value | equal:compareValue }}
        {{ condition | ternary:'yes':'no' }}
    `
})
```

### Directives

```typescript
import { RtIconOutlinedDirective, ScrollToElementDirective } from '@rt-tools/utils';

@Component({
    imports: [RtIconOutlinedDirective, ScrollToElementDirective],
    template: `
        <mat-icon rtIconOutlined>settings</mat-icon>
        <div rtScrollToElement [scrollTarget]="target"></div>
    `
})
```

### Services

```typescript
import { BreakpointService, DeviceDetectorService } from '@rt-tools/utils';

@Component({ /* ... */ })
export class MyComponent {
    private breakpointService = inject(BreakpointService);
    private deviceDetector = inject(DeviceDetectorService);

    isMobile = this.breakpointService.isMobile;
    isDesktop = this.breakpointService.isDesktop;
}
```

### Providers

```typescript
import { provideRtUtils } from '@rt-tools/utils';

bootstrapApplication(RootComponent, {
    providers: [
        provideRtUtils()
    ]
});
```

## Requirements

- Angular 21+
- @rt-tools/core ^0.0.1
- RxJS 7.8+

## License

Apache-2.0