open-index/open-npm huggingface dataset:
npm package: @jobians/arrify
Description: A TypeScript utility function that converts various types of values into arrays.
Author: JOBIANSTECHIE
Latest version: 1.0.0

# @jobians/arrify

A TypeScript utility function that converts various types of values into arrays.

## Installation

You can install the package using npm:

```bash
npm install @jobians/arrify
```

## Importing

### ES Module

```typescript
import arrify from '@jobians/arrify';
```

### CommonJS

```javascript
const arrify = require('@jobians/arrify');
```

## Usage

The `arrify` function accepts a value and returns an array. It handles various types of input, including:

- `null` and `undefined` return an empty array.
- Strings are wrapped in an array.
- Arrays are returned as-is.
- Iterables are spread into an array.
- All other values are wrapped in an array.

### Example

```typescript
import arrify from '@jobians/arrify';

// Convert a string to an array
const result1 = arrify("hello");
console.log(result1); // Output: ["hello"]

// Convert a number to an array
const result2 = arrify(42);
console.log(result2); // Output: [42]

// Convert an array to an array
const result3 = arrify([1, 2, 3]);
console.log(result3); // Output: [1, 2, 3]

// Convert null to an empty array
const result4 = arrify(null);
console.log(result4); // Output: []

// Convert undefined to an empty array
const result5 = arrify(undefined);
console.log(result5); // Output: []

// Convert a Set to an array
const result6 = arrify(new Set([1, 2, 3]));
console.log(result6); // Output: [1, 2, 3]

// Convert a Map's values to an array
const result7 = arrify(new Map([[1, 'a'], [2, 'b']]).values());
console.log(result7); // Output: ['a', 'b']
```

## API

### `arrify<T>(value: T | T[] | null | undefined): T[]`

- **Parameters**:
  - `value`: The input value to convert into an array.

- **Returns**: An array containing the input value.

## TypeScript Support

This package is written in TypeScript and provides type definitions. You can use it seamlessly in TypeScript projects, ensuring type safety.

## Support

If you find my work helpful, you can support me by donating:

[![Donate](https://img.shields.io/badge/Donate-Crypto-0070BA.svg)](https://cwallet.com/t/TE6A6KMV)
npm package: @jobilla/feature-toggles
Description: This is a library for use in JavaScript and TypeScript applications to allow you to conditionally execute code/show some parts of your frontend depending on if a feature is enabled or not.
Author: Leo Sjöberg
Latest version: 1.2.0

# Jobilla Feature Toggles

This is a library for use in JavaScript and TypeScript applications to allow you to
conditionally execute code/show some parts of your frontend depending on if a feature is
enabled or not.

This is meant for in-development features where you might want to ship incrementally to
your testing environment but ship the entire feature to your customers. It ensures that
you can still deploy to production, but having unfinished features hidden.

## Installation

 This package can be installed with NPM:
 
 ```
npm install @jobilla/feature-toggles
```

## Usage

First, to activate feature toggles for your app, simply instantiate the service:
```javascript
const toggles = new FeatureToggleService();
```

You may then proceed to register any service you want:
```javascript
toggles.register({
    name: "New Sidebar",
    key: "new_sidebar"
});
```

We recommend that you register **all** your features in the root of your application.

You may then, anywhere in your code, check whether the feature is enabled:

```
if (toggles.check('new_sidebar')) {
    renderNewSidebar();
} else {
    renderOldSidebar();
}
```

### Enabling and disabling features

Features are stored as stringified JSON in `localStorage`. You may either manually change
the `enabled` value for a feature in `localStorage`, or you can use our [companion Chrome
plugin](https://github.com/jobilla/feature-toggles-chrome).