fix(typescript): remove incorrect file extensions (#20194)

* fix(typescript): remove incorrect file extensions

url, http, and https are Node.js core modules, and form-data
should be loaded using a bare specifier. This commit removes
the file extensions from these imports.

* update samples
This commit is contained in:
Colin Ihrig 2024-12-02 09:51:49 -05:00 committed by GitHub
parent 1eaa75bd36
commit 06f0b68eee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 10 additions and 10 deletions

View File

@ -1,10 +1,10 @@
{{#platforms}}
{{#node}}
// TODO: evaluate if we can easily get rid of this library
import {{^supportsES6}}* as{{/supportsES6}} FormData from "form-data{{importFileExtension}}";
import { URL, URLSearchParams } from 'url{{importFileExtension}}';
import * as http from 'http{{importFileExtension}}';
import * as https from 'https{{importFileExtension}}';
import {{^supportsES6}}* as{{/supportsES6}} FormData from "form-data";
import { URL, URLSearchParams } from 'url';
import * as http from 'http';
import * as https from 'https';
{{/node}}
{{/platforms}}
import { Observable, from } from {{#useRxJS}}'rxjs'{{/useRxJS}}{{^useRxJS}}'../rxjsStub{{importFileExtension}}'{{/useRxJS}};
@ -169,7 +169,7 @@ export class RequestContext {
}
{{#platforms}}
{{#node}}
public setAgent(agent: http.Agent | https.Agent) {
this.agent = agent;
}

View File

@ -134,7 +134,7 @@ export class RequestContext {
public setHeaderParam(key: string, value: string): void {
this.headers[key] = value;
}
public setAgent(agent: http.Agent | https.Agent) {
this.agent = agent;
}

View File

@ -134,7 +134,7 @@ export class RequestContext {
public setHeaderParam(key: string, value: string): void {
this.headers[key] = value;
}
public setAgent(agent: http.Agent | https.Agent) {
this.agent = agent;
}

View File

@ -134,7 +134,7 @@ export class RequestContext {
public setHeaderParam(key: string, value: string): void {
this.headers[key] = value;
}
public setAgent(agent: http.Agent | https.Agent) {
this.agent = agent;
}

View File

@ -134,7 +134,7 @@ export class RequestContext {
public setHeaderParam(key: string, value: string): void {
this.headers[key] = value;
}
public setAgent(agent: http.Agent | https.Agent) {
this.agent = agent;
}

View File

@ -134,7 +134,7 @@ export class RequestContext {
public setHeaderParam(key: string, value: string): void {
this.headers[key] = value;
}
public setAgent(agent: http.Agent | https.Agent) {
this.agent = agent;
}