From 4c3d12fe71a4da7be62895830da190fd5d5262a3 Mon Sep 17 00:00:00 2001 From: Alex Corrado Date: Fri, 3 May 2024 15:14:29 +0100 Subject: [PATCH] Add `DeepReadonly` (#3) * Add `DeepReadonly` * Update package.json --- package.json | 2 +- src/index.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 987cd29..0b6c5a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@glideapps/ts-necessities", - "version": "2.2.3", + "version": "2.2.4", "description": "Small utilities to make life with TypeScript easier", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/index.ts b/src/index.ts index 5e736e8..14392d8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -93,6 +93,8 @@ export type Writable = { -readonly [P in keyof T]: T[P] }; export type DeepWritable = { -readonly [P in keyof T]: DeepWritable }; +export type DeepReadonly = { readonly [P in keyof T]: DeepReadonly }; + /** * If `x` is undefined, return `undefined`. Otherwise, return `f(x)`. */