result-tsk
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "result-tsk", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "tool for use with or without NodeTskeleton template project", | ||
@@ -10,7 +10,4 @@ "repository": { | ||
"keywords": [ | ||
"node", | ||
"ts", | ||
"skeleton", | ||
"nodejs", | ||
"typescript", | ||
"result", | ||
"tskeleton", | ||
"tool" | ||
@@ -31,3 +28,3 @@ ], | ||
"build": "rm -rf lib/* && tsc --sourceMap false", | ||
"publish": "npm run build && npm publish" | ||
"upload": "npm run build && npm publish" | ||
}, | ||
@@ -34,0 +31,0 @@ "devDependencies": { |
@@ -9,3 +9,3 @@ # Result tool 🧰 | ||
### Using Result | ||
## Using Result | ||
@@ -15,3 +15,3 @@ `Result` is a `tool` that helps us control the flow of our `use cases` and allows us to `manage the response`, be it an `object`, an `array` of objects, a `message` or an `error` as follows: | ||
```ts | ||
import { IResult } from "result-tsk"; | ||
import { IResultT, ResultT } from "result-tsk"; | ||
@@ -23,5 +23,5 @@ export class UseCaseProductGet extends BaseUseCase { | ||
async Execute(idMask: string): Promise<IResult<ProductDto>> { | ||
async Execute(idMask: string): Promise<IResultT<ProductDto>> { | ||
// We create the instance of our type of result at the beginning of the use case. | ||
const result = new Result<ProductDto>(); | ||
const result = new ResultT<ProductDto>(); | ||
// With the resulting object we can control validations within other functions. | ||
@@ -57,3 +57,3 @@ if (!this.validator.IsValidEntry(result, { productMaskId: idMask })) { | ||
The `result` object can help you in unit tests as shown below: | ||
The `result object` can help you in `unit tests` as shown below: | ||
@@ -60,0 +60,0 @@ ```ts |
8909