mirror of
https://github.com/yt-dlp/ejs.git
synced 2026-06-17 02:32:20 +00:00
Add formatting/linting CI (#18)
This commit is contained in:
@@ -25,7 +25,9 @@ export function matchesStructure<T extends ESTree.Node>(
|
||||
if ("anykey" in structure && Array.isArray(structure.anykey)) {
|
||||
// Handle `{ anykey: [a, b] }`
|
||||
const haystack = Array.isArray(obj) ? obj : Object.values(obj);
|
||||
return structure.anykey.every(value => haystack.some((el) => matchesStructure(el, value)));
|
||||
return structure.anykey.every((value) =>
|
||||
haystack.some((el) => matchesStructure(el, value)),
|
||||
);
|
||||
}
|
||||
for (const [key, value] of Object.entries(structure)) {
|
||||
if (!matchesStructure(obj[key as keyof typeof obj], value)) {
|
||||
|
||||
@@ -24,6 +24,7 @@ export async function getIO(): Promise<IO> {
|
||||
|
||||
async function _getIO(): Promise<IO> {
|
||||
// Old Deno requires casting to any as globalThis lacks an index signature
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if ((globalThis as any).process?.release?.name === "node") {
|
||||
// Assume node compatibility
|
||||
const { access, readFile } = await import("node:fs/promises");
|
||||
|
||||
Reference in New Issue
Block a user