UNPKG

@yookue/ts-lang-utils

Version:

Common lang utilities for typescript

12 lines 306 B
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; export function add(array, element) { if (!array) { return !element ? undefined : [element]; } if (!element) { return array; } var result = _toConsumableArray(array); result.push(element); return result; }