UNPKG

@yookue/ts-lang-utils

Version:

Common lang utilities for typescript

9 lines 324 B
import { isNotNil } from "./isNotNil"; export function firstNotNil() { for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) { objects[_key] = arguments[_key]; } return !objects || !objects.length ? undefined : objects.find(function (item) { return isNotNil(item); }); }