persona-community-5/.pnpm-store/v3/files/29/00da59daa7e89b8ac83e0bc1f841f5c0e6ad00c7c0a582dd170da9b4eeaedb8561930f49c4b95d770c908afd0434b331bddc6f0722afbe7aac53e6f03a8d15
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

30 lines
637 B
Plaintext

/**
Create a type that represents either the value or an array of the value.
@see Promisable
@example
```
import type {Arrayable} from 'type-fest';
function bundle(input: string, output: Arrayable<string>) {
const outputList = Array.isArray(output) ? output : [output];
// …
for (const output of outputList) {
console.log(`write to: ${output}`);
}
}
bundle('src/index.js', 'dist/index.js');
bundle('src/index.js', ['dist/index.cjs', 'dist/index.mjs']);
```
@category Array
*/
export type Arrayable<T> =
T
// TODO: Use `readonly T[]` when this issue is resolved: https://github.com/microsoft/TypeScript/issues/17002
| T[];