@nu-art/ts-common 0.202.78 → 0.202.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils/types.d.ts +6 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nu-art/ts-common",
3
- "version": "0.202.78",
3
+ "version": "0.202.79",
4
4
  "description": "js and ts infra",
5
5
  "keywords": [
6
6
  "TacB0sS",
package/utils/types.d.ts CHANGED
@@ -155,6 +155,12 @@ export type RecursiveOmit<T, OmitKey extends keyof any> = {
155
155
  export type RecursivePartial<T> = {
156
156
  [P in keyof T]?: T[P] extends any[] ? T[P] : T[P] extends object ? RecursivePartial<T[P]> : T[P];
157
157
  };
158
+ export type RecursiveReadonly<T> = T extends undefined ? undefined : T extends (infer R)[] ? ReadonlyArray<RecursiveReadonly<R>> : T extends object ? Readonly<{
159
+ [P in keyof T]: Readonly<T[P]>;
160
+ }> : T;
161
+ export type RecursiveWritable<T> = T extends ReadonlyArray<infer R> ? RecursiveWritable<R>[] : T extends object ? {
162
+ -readonly [P in keyof T]: RecursiveWritable<T[P]>;
163
+ } : T;
158
164
  /**
159
165
  * Constructs a union of string paths representing the properties and nested properties of an object type.
160
166
  *