pwi-plata-type 0.4.208 → 0.4.209

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pwi-plata-type",
3
- "version": "0.4.208",
3
+ "version": "0.4.209",
4
4
  "main": "__BUILD__/index",
5
5
  "types": "src/@types/exported.d.ts",
6
6
  "bin": {
@@ -113,7 +113,9 @@ interface PlataEnvConfig {
113
113
 
114
114
  type DeepWritable<T extends {}> = Prettify<{
115
115
  -readonly [K in keyof T]: T[K] extends Dictionary<any> ?
116
- T[K] extends Date ? Date : DeepWritable<T[K]>
116
+ T[K] extends Date ? Date
117
+ : T[K] extends Brand<infer R> ? Brand<R>
118
+ : DeepWritable<T[K]>
117
119
  : T[K]
118
120
  }>
119
121
 
@@ -34,6 +34,7 @@ describe('Brands', () => {
34
34
  | AssertType<typeof modelTest.type['brandString'], string, true>
35
35
  | AssertType<string, typeof modelTest.type['brandString'], false>
36
36
  | AssertType<typeof modelTest.type['brandString'], Brand<'testeModel'>, true>
37
+ | AssertType<DeepWritable<{ readonly value: Brand<'testBrand'> }>, { value: Brand<'testBrand'> }, true>
37
38
  ;
38
39
 
39
40
  it('preserva a referência e valor em runtime e altera apenas o tipo', () => {