UNPKG

@teamix/typography

Version:
19 lines (17 loc) 635 B
// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead export var tuple = function tuple() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return args; }; export var tupleNum = function tupleNum() { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return args; }; /** * https://stackoverflow.com/a/59187769 Extract the type of an element of an array/tuple without * performing indexing */