@teamix/typography
Version:
30 lines (22 loc) • 763 B
JavaScript
;
exports.__esModule = true;
exports.tupleNum = exports.tuple = void 0;
// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead
var tuple = function tuple() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return args;
};
exports.tuple = tuple;
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
*/
exports.tupleNum = tupleNum;