Skip to content

Commit 166b231

Browse files
refactor: move native runtime bindings into src/native
1 parent d0f5856 commit 166b231

9 files changed

Lines changed: 8 additions & 227 deletions

File tree

src/http/fetch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
runBeforeRetryHooks,
88
runInitHooks,
99
} from '../hooks';
10-
import { normalizeMethod } from '../native';
10+
import { normalizeMethod } from '../native/index';
1111
import type { RedirectEntry, RequestInput, RetryDecisionContext, WreqInit } from '../types';
1212
import { loadCookiesIntoRequest, persistResponseCookies } from './pipeline/cookies';
1313
import { dispatchNativeRequest, reportStats } from './pipeline/dispatch';

src/http/pipeline/dispatch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AbortError, RequestError, TimeoutError } from '../../errors';
2-
import { nativeRequest } from '../../native';
2+
import { nativeRequest } from '../../native/index';
33
import type { NativeRequestOptions, RequestStats, WreqInit } from '../../types';
44
import { Response } from '../response';
55

src/http/pipeline/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { serializeEmulationOptions } from '../../config/emulation';
33
import { normalizeDnsOptions, normalizeProxyOptions } from '../../config/network';
44
import { normalizeCertificateAuthority, normalizeTlsIdentity } from '../../config/tls';
55
import { Headers } from '../../headers';
6-
import { normalizeMethod, validateBrowserProfile } from '../../native';
6+
import { normalizeMethod, validateBrowserProfile } from '../../native/index';
77
import type {
88
NativeRequestOptions,
99
ResolvedOptions,

src/http/pipeline/redirects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { RequestError } from '../../errors';
22
import { Headers } from '../../headers';
3-
import { normalizeMethod } from '../../native';
3+
import { normalizeMethod } from '../../native/index';
44
import type { BodyInit, HttpMethod, RedirectEntry } from '../../types';
55
import { Response } from '../response';
66

src/http/pipeline/retries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { normalizeMethod } from '../../native';
1+
import { normalizeMethod } from '../../native/index';
22
import type { ResolvedRetryOptions, RetryDecisionContext } from '../../types';
33
import { inferErrorCode } from './errors';
44

src/http/response.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { STATUS_CODES } from 'node:http';
33
import { ReadableStream } from 'node:stream/web';
44
import { TextDecoder } from 'node:util';
55
import { Headers } from '../headers';
6-
import { nativeCancelBody, nativeReadBodyChunk } from '../native';
6+
import { nativeCancelBody, nativeReadBodyChunk } from '../native/index';
77
import type {
88
BodyInit,
99
HeadersInit,

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Headers } from './headers';
55
import { fetch } from './http/fetch';
66
import { Request } from './http/request';
77
import { Response } from './http/response';
8-
import { getProfiles } from './native';
8+
import { getProfiles } from './native/index';
99
import type {
1010
AfterResponseContext,
1111
AlpnProtocol,

src/native.ts

Lines changed: 0 additions & 219 deletions
This file was deleted.

src/websocket/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
nativeWebSocketSendBinary,
1111
nativeWebSocketSendText,
1212
validateBrowserProfile,
13-
} from '../native';
13+
} from '../native/index';
1414
import type { WebSocketBinaryType, WebSocketInit } from '../types';
1515
import { CloseEvent } from './close-event';
1616
import { getSendByteLength, normalizeSendData, toMessageEventData } from './send-data';

0 commit comments

Comments
 (0)