New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

result-tsk

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

result-tsk - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

6

CHANGELOG.md

@@ -94,1 +94,7 @@ # Changelog

- Fix function name
## [2.1.2] — 2022-04-29
### Feature
- Function to validate if error was added

1

lib/generic/Result.d.ts

@@ -18,4 +18,5 @@ import { Metadata } from "../Result.interface";

setError(error: string, statusCode: number | string): void;
hasError(): boolean;
setData(data: string | T, statusCode: number | string, message?: string): void;
toResultDto(): ResultDto;
}

@@ -49,2 +49,5 @@ "use strict";

}
hasError() {
return !!this.error;
}
setData(data, statusCode, message) {

@@ -51,0 +54,0 @@ this.data = data;

@@ -16,3 +16,4 @@ import { Metadata, IResult } from "./Result.interface";

setError(error: string, statusCode: number | string): void;
hasError(): boolean;
toResultDto(): ResultDto;
}

@@ -11,2 +11,3 @@ import { ResultDto } from "./ResultDto";

setError(error: string, statusCode: number | string): void;
hasError(): boolean;
toResultDto(): ResultDto;

@@ -13,0 +14,0 @@ setMetadata(headers: Metadata): void;

@@ -49,2 +49,5 @@ "use strict";

}
hasError() {
return !!this.error;
}
toResultDto() {

@@ -51,0 +54,0 @@ const result = new ResultDto_1.ResultDto();

2

lib/ResultDto.d.ts
export declare class ResultDto {
message: string;
error: string;
data: any;
data: unknown;
}
{
"name": "result-tsk",
"version": "2.1.1",
"version": "2.1.2",
"description": "result tool for use with or without NodeTskeleton template project",

@@ -5,0 +5,0 @@ "repository": {

@@ -37,2 +37,5 @@ # Result tool 🧰

}
// Or
if (result.hasError()) return result;
const productDto = this.mapper.mapObject<Product, ProductDto>(product, new ProductDto());

@@ -68,2 +71,4 @@ // The result object also helps you with the response data.

expect(result.statusCode).toBe(resultCodes.BAD_REQUEST);
// Or you can create a ResultMock builder to do the following
expect(result).toEqual(resultBuilder);
});

@@ -70,0 +75,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc