Website Structure

This commit is contained in:
supalerk-ar66 2026-01-13 10:46:40 +07:00
parent 62812f2090
commit 71f0676a62
22365 changed files with 4265753 additions and 791 deletions

View file

@ -0,0 +1,5 @@
export type Callback<E = Error | null | undefined> = (error?: E) => void;
export type HeadersObject = {
[key: string]: string | string[] | undefined;
};
export type BufferEncoding = any;

View file

@ -0,0 +1 @@
export {};

View file

@ -0,0 +1,14 @@
import type { HeadersObject } from "./types.mjs";
export declare function rawHeaders(headers: HeadersObject);
type Fn = (...args: any[]) => any;
export declare function mergeFns(...functions: Fn[]): unknown;
export declare function createNotImplementedError(name: string);
export declare function notImplemented<Fn extends (...args: any) => any>(name: string): Fn;
export interface Promisifiable {
(): any;
native: Promisifiable;
__promisify__: () => Promise<any>;
}
export declare function notImplementedAsync(name: string): Promisifiable;
export declare function notImplementedClass<T = unknown>(name: string): T;
export {};

View file

@ -0,0 +1,49 @@
/* @__NO_SIDE_EFFECTS__ */
export function rawHeaders(headers) {
const rawHeaders = [];
for (const key in headers) {
if (Array.isArray(headers[key])) {
for (const h of headers[key]) {
rawHeaders.push(key, h);
}
} else {
rawHeaders.push(key, headers[key]);
}
}
return rawHeaders;
}
/* @__NO_SIDE_EFFECTS__ */
export function mergeFns(...functions) {
return function(...args) {
for (const fn of functions) {
fn(...args);
}
};
}
/* @__NO_SIDE_EFFECTS__ */
export function createNotImplementedError(name) {
return new Error(`[unenv] ${name} is not implemented yet!`);
}
/* @__NO_SIDE_EFFECTS__ */
export function notImplemented(name) {
const fn = () => {
throw createNotImplementedError(name);
};
return Object.assign(fn, { __unenv__: true });
}
/* @__NO_SIDE_EFFECTS__ */
export function notImplementedAsync(name) {
const fn = notImplemented(name);
fn.__promisify__ = () => notImplemented(name + ".__promisify__");
fn.native = fn;
return fn;
}
/* @__NO_SIDE_EFFECTS__ */
export function notImplementedClass(name) {
return class {
__unenv__ = true;
constructor() {
throw new Error(`[unenv] ${name} is not implemented yet!`);
}
};
}