Skip to content

Commit

Permalink
feat(CV-286): added DeepReadonly type
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-jonathan committed Jul 5, 2023
1 parent 0bc5fbe commit 1cdfca3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cosmicmind/foundationjs",
"version": "0.0.1-rc-070423-1",
"version": "0.0.1-rc-070423-1-a",
"description": "A library of helpful tools for developing projects in TypeScript.",
"keywords": [],
"author": {
Expand Down
2 changes: 1 addition & 1 deletion src/type-defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export type PickNullable<T> = Pick<T, NullableKeysFor<T>>
export type PickPartial<T> = Pick<T, PartialKeysFor<T>>

export type DeepReadonly<T, K extends keyof T = keyof T> = {
readonly [P in K]: T[P] extends Record<string | number | symbol, unknown>
readonly [P in K]: T[P] extends Record<string | number | symbol, unknown> | unknown[]
? DeepReadonly<T[P]>
: T[P]
}

0 comments on commit 1cdfca3

Please sign in to comment.