mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
14 lines
259 B
TypeScript
14 lines
259 B
TypeScript
import last = require('last-element');
|
|
|
|
// $ExpectType string
|
|
const latestVersion = last(['1.0.0', '2.0.0']);
|
|
|
|
// $ExpectType number[]
|
|
const lastElement = last([[3, 234], [41, 1]]);
|
|
|
|
// @ts-expect-error
|
|
last(3);
|
|
|
|
// @ts-expect-error
|
|
last<number>(['string']);
|