Spaces:
Paused
Paused
Download node_modules/arrify/index.d.ts from Huzaifa1313/prof002313: direct link, hf CLI and curl.
- Browser
- Download file 645 Bytes
-
https://huggingface.co/spaces/Huzaifa1313/prof002313/resolve/main/node_modules/arrify/index.d.ts
- Command line
-
hf download hf://spaces/Huzaifa1313/prof002313/node_modules/arrify/index.d.ts
-
curl -L -o index.d.ts https://huggingface.co/spaces/Huzaifa1313/prof002313/resolve/main/node_modules/arrify/index.d.ts
645 Bytes
| /** | |
| Convert a value to an array. | |
| _Supplying `null` or `undefined` results in an empty array._ | |
| @example | |
| ``` | |
| import arrify = require('arrify'); | |
| arrify('π¦'); | |
| //=> ['π¦'] | |
| arrify(['π¦']); | |
| //=> ['π¦'] | |
| arrify(new Set(['π¦'])); | |
| //=> ['π¦'] | |
| arrify(null); | |
| //=> [] | |
| arrify(undefined); | |
| //=> [] | |
| ``` | |
| */ | |
| declare function arrify<ValueType>( | |
| value: ValueType | |
| ): ValueType extends (null | undefined) | |
| ? [] | |
| : ValueType extends string | |
| ? [string] | |
| : ValueType extends ReadonlyArray<unknown> // TODO: Use 'readonly unknown[]' in the next major version | |
| ? ValueType | |
| : ValueType extends Iterable<infer T> | |
| ? T[] | |
| : [ValueType]; | |
| export = arrify; | |