Skip to content

Commit

Permalink
docs: update version
Browse files Browse the repository at this point in the history
  • Loading branch information
4lessandrodev committed Dec 21, 2024
1 parent a01d616 commit 003cfd7
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
51 changes: 50 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,60 @@ All notable changes to this project will be documented in this file.

---


## Released

---

### [1.25.1] - 2024-12-20

#### **Feat**

- **Dynamic Typing in `Result` Made Optional**:
- Developers can now choose between `Result<T>` (non-nullable) and `Result<T | null>` (nullable), based on their specific use case.
- This update allows greater flexibility for explicit `null` handling without forcing unnecessary complexity in scenarios where nullability is not required.

#### **Examples**

1. **Explicit Null Handling**:
Use `Result<T | null>` to manage nullable states explicitly:
```typescript
class SampleNullish {
public static create(props: Props): Result<SampleNullish | null> {
if (!props.name || props.name.trim() === '') {
return Fail('name is required');
}
return Ok(new SampleNullish(props));
}
}
```

2. **Non-Nullable Values**:
Use `Result<T>` for cases where null handling is unnecessary:
```typescript
class Sample {
public static create(props: Props): Result<Sample> {
if (!props.name || props.name.trim() === '') {
return Fail('name is required');
}
return Ok(new Sample(props));
}
}
```

#### **Fix**

- Enhanced backward compatibility by making nullable typing optional, ensuring existing integrations using `Result<T>` remain unaffected.

#### **Impact**

- **Improved Flexibility**:
Developers can adapt the `Result` type to suit their needs, supporting nullable and non-nullable use cases seamlessly.

- **Enhanced Clarity**:
Provides explicit type inference, ensuring safer and more intuitive code handling for nullable scenarios.

---

### [1.25.0] - 2024-12-17

#### Feat
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rich-domain",
"version": "1.25.0",
"version": "1.25.1",
"description": "This package provide utils file and interfaces to assistant build a complex application with domain driving design",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 003cfd7

Please sign in to comment.