forked from profectus/Profectus
Add utility type for the values within a readonly array
This commit is contained in:
parent
21eb5409b4
commit
e8ba3f1f88
1 changed files with 4 additions and 0 deletions
|
@ -1,5 +1,9 @@
|
||||||
export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
|
export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
|
||||||
|
|
||||||
|
export type ArrayElements<T extends ReadonlyArray<unknown>> = T extends ReadonlyArray<infer S>
|
||||||
|
? S
|
||||||
|
: never;
|
||||||
|
|
||||||
// Reference:
|
// Reference:
|
||||||
// https://stackoverflow.com/questions/7225407/convert-camelcasetext-to-sentence-case-text
|
// https://stackoverflow.com/questions/7225407/convert-camelcasetext-to-sentence-case-text
|
||||||
export function camelToTitle(camel: string): string {
|
export function camelToTitle(camel: string): string {
|
||||||
|
|
Loading…
Reference in a new issue