/
Array.ts
30 lines (23 loc) · 823 Bytes
/
Array.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import * as _ from '../../src/Array'
import { NonEmptyArray } from '../../src/NonEmptyArray'
declare const ns: Array<number>
declare const ss: Array<string>
declare const nens: NonEmptyArray<number>
declare const sess: NonEmptyArray<string>
declare const tns: Array<[number, string]>
declare const netns: NonEmptyArray<[number, string]>
//
// zip
//
_.zip(ns, ss) // $ExpectType [number, string][]
_.zip(nens, sess) // $ExpectType NonEmptyArray<[number, string]>
//
// zipWith
//
_.zipWith(ns, ss, (n, s) => [n, s] as const) // $ExpectType (readonly [number, string])[]
_.zipWith(nens, sess, (n, s) => [n, s] as const) // $ExpectType NonEmptyArray<readonly [number, string]>
//
// unzip
//
_.unzip(tns) // $ExpectType [number[], string[]]
_.unzip(netns) // $ExpectType [NonEmptyArray<number>, NonEmptyArray<string>]