Sha256: 3238e3ed704fe1ba3d523a8a5c8ffd8ca3250a8898cf75ac5e6b13d132a8d226

Contents?: true

Size: 537 Bytes

Versions: 28

Compression:

Stored size: 537 Bytes

Contents

/**
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 | readonly T[];

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.25 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.24 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.23 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.22 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.21 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.20 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.19 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.18 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.17 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.16 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.15 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.14 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.13 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.12 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.11 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.10 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.9 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.8 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts
clapton-0.0.7 lib/clapton/javascripts/node_modules/type-fest/source/arrayable.d.ts