Page MenuHomeSealhub

utils.ts
No OneTemporary

utils.ts

export type Awaited<T> = T extends Promise<infer U> ? U : T;
export type UnwrapArray<T> = T extends Array<infer U> ? U : T;
export function keys<S extends string>(object: Record<S, unknown>): S[] {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any
return Object.keys(object) as any;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type ExtractTail<T extends any[]> = T extends [infer _, ...infer Tail]
? Tail
: never;
export { sleep } from "./sleep.js";
export { naturalNumbers } from "./natural-numbers.js";
export { UrlWithNewParams } from "./url-with-new-params.js";
export { exec } from "./exec.js";
export { importPath, curryImportPath } from "./import-path.js";
export { listCollections } from "./list-collections.js";
export { walkDir } from "./walk.js";
export { assertThrowsAsync } from "./assert-throws.js";
export * from "./make-slug.js";
export * from "./render-attributes.js";
export * from "./format-external-url.js";
export * from "./base64.js";

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 24, 15:15 (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
601289
Default Alt Text
utils.ts (1 KB)

Event Timeline