@ng-openapi/http-resource 0.0.27 → 0.0.28

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.
Files changed (3) hide show
  1. package/index.cjs +2 -8
  2. package/index.js +2 -8
  3. package/package.json +1 -1
package/index.cjs CHANGED
@@ -3106,15 +3106,12 @@ ${paramMappings}`;
3106
3106
  }
3107
3107
  generateHeaders(context) {
3108
3108
  const hasCustomHeaders = this.config.options.customHeaders;
3109
- if (!hasCustomHeaders) {
3110
- return "";
3111
- }
3112
3109
  let headerCode = `
3113
3110
  let headers: HttpHeaders;
3114
3111
  if (requestOptions?.headers instanceof HttpHeaders) {
3115
3112
  headers = requestOptions.headers;
3116
3113
  } else {
3117
- headers = new HttpHeaders(requestOptions?.headers as Record<string, string>);
3114
+ headers = new HttpHeaders(requestOptions?.headers);
3118
3115
  }`;
3119
3116
  if (hasCustomHeaders) {
3120
3117
  headerCode += `
@@ -3133,10 +3130,7 @@ ${Object.entries(this.config.options.customHeaders || {}).map(([key, value]) =>
3133
3130
  if (context.queryParams.length > 0) {
3134
3131
  options.push("params");
3135
3132
  }
3136
- const hasHeaders = this.config.options.customHeaders;
3137
- if (hasHeaders) {
3138
- options.push("headers");
3139
- }
3133
+ options.push("headers");
3140
3134
  if (context.responseType !== "json") {
3141
3135
  options.push(`responseType: '${context.responseType}' as '${context.responseType}'`);
3142
3136
  }
package/index.js CHANGED
@@ -3072,15 +3072,12 @@ ${paramMappings}`;
3072
3072
  }
3073
3073
  generateHeaders(context) {
3074
3074
  const hasCustomHeaders = this.config.options.customHeaders;
3075
- if (!hasCustomHeaders) {
3076
- return "";
3077
- }
3078
3075
  let headerCode = `
3079
3076
  let headers: HttpHeaders;
3080
3077
  if (requestOptions?.headers instanceof HttpHeaders) {
3081
3078
  headers = requestOptions.headers;
3082
3079
  } else {
3083
- headers = new HttpHeaders(requestOptions?.headers as Record<string, string>);
3080
+ headers = new HttpHeaders(requestOptions?.headers);
3084
3081
  }`;
3085
3082
  if (hasCustomHeaders) {
3086
3083
  headerCode += `
@@ -3099,10 +3096,7 @@ ${Object.entries(this.config.options.customHeaders || {}).map(([key, value]) =>
3099
3096
  if (context.queryParams.length > 0) {
3100
3097
  options.push("params");
3101
3098
  }
3102
- const hasHeaders = this.config.options.customHeaders;
3103
- if (hasHeaders) {
3104
- options.push("headers");
3105
- }
3099
+ options.push("headers");
3106
3100
  if (context.responseType !== "json") {
3107
3101
  options.push(`responseType: '${context.responseType}' as '${context.responseType}'`);
3108
3102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-openapi/http-resource",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "description": "HTTP Resource plugin for ng-openapi - Angular HTTP utilities with caching and state management",
5
5
  "keywords": [
6
6
  "angular",