Open sindresorhus opened 1 month ago
Would be annoying as input
I think that kills it, because you can't assign this return value to anything that accepts Date
, so it's barely "read-only". Having to use date as Date
every time isn't great
Would probably be better to do this as a typed readonly wrapper / proxy to Date
with a way to get a full date.
const foo: ReadonlyDate = new ReadonlyDate();
const bar: Date = foo.getDate();
Type description + examples
Would be annoying as input, but can be useful as a return value.
Type source
Search existing types and issues first
Upvote & Fund