You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript utility type in order to ensure to return only properties (not methods) containing values in primitive types such as number or boolean (not Value Objects).
17
+
TypeScript utility type to ensure to return only properties (not methods) containing values in primitive types such as number or boolean (not Value Objects).
18
18
<br />
19
19
<br />
20
20
Take a look, play and have fun with this.
@@ -54,7 +54,7 @@ When we want to have a `toPrimitives` method in order to pass an instance of the
54
54
That is:
55
55
56
56
- We want to **avoid including methods** such as the `thisFunctionShouldNotBeIncludedInTheToPrimitives` one, so the transformation should only include properties.
57
-
- We want to **flatten or unwrap encapsulated properties** such as the `courseId` and `courseTitle` ones. They are modelled as Value Objects (`CourseId` and `CourseTitle` classes), so the transformation or flatten should only include properties in a recursive manner.
57
+
- We want to **flatten or unwrap encapsulated properties** such as the `courseId` and `courseTitle` ones. They are modeled as Value Objects (`CourseId` and `CourseTitle` classes), so the transformation or flatten should only include properties in a recursive manner.
58
58
59
59
That is exactly what our `Primitives<T>` utility type guarantees. Let's add it! 💪
0 commit comments