Function makeNumberSubtypeArray

Given a list of number literals and/or number subtype arrays, creates a typed, flattened array.

For example:

const x = makeNumberSubtypeArray(1, 2);
type X = typeof x[0];
const y = makeNumberSubtypeArray(x, 3);
type Y = typeof y[0];

In the above example:

  • the type of x is Array<1 | 2>
  • the type of y is Array<1 | 2 | 3>

and so:

  • 'X' is 1 | 2
  • 'Y' is 1 | 2 | 3