Proposal: `isTuple`
I don't know if this could be added to is, but it could be useful to infer typescript tuple type value.
declare const value: unknown;
if(isTuple(value, [is.number, is.string])) {
value //=> [number, string]
}
Seems out of scope for this library.
Can this issue be suggested for is?
Can this issue be suggested for is?
Yes, I moved the issue.
How should this work with ES Tuples (#133)? Maybe is.tsTuple? is.TupleLike? I know the proposal is still a while out from shipping, but it’s worth future-proofing against.
I feel is.tupleLike feels fine, since it caters to the ts-tuple, and leaves is.tuple for when the tc39 proposal is closer
@sindresorhus your thoughts?
is.tupleLike sounds good.
I'll take a shot at this
closed :)
@sindresorhus friendly bump that this can be closed :)