Casts an array to the structural empty tuple after checking that it is empty.
This is the structural counterpart of asEmptyArray, and the length-0 specialization of asFixedLengthTuple.
asEmptyArray
The input array type (tuple types are preserved).
The array to cast.
xs typed as readonly [] & Xs.
xs
readonly [] & Xs
const nothing = Arr.asEmptyTuple([]);assert.deepStrictEqual(nothing, []);assert.throws(() => Arr.asEmptyTuple([1]), TypeError); Copy
const nothing = Arr.asEmptyTuple([]);assert.deepStrictEqual(nothing, []);assert.throws(() => Arr.asEmptyTuple([1]), TypeError);
If xs is not empty.
Casts an array to the structural empty tuple after checking that it is empty.
This is the structural counterpart of
asEmptyArray, and the length-0 specialization of asFixedLengthTuple.