Skip to content

Commit

Permalink
feat: exclude unwanted function names
Browse files Browse the repository at this point in the history
  • Loading branch information
Odonno committed Sep 14, 2024
1 parent 6e70f16 commit 293bf92
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const repositoryName = "surrealdb/surrealdb";
const branch = "main";
const fncSourceCodeFilePath = "core/src/fnc/mod.rs";

const fncExclusions = [".chain"];

const detectMissingFunctions = async () => {
console.log("Detecting missing functions...");
console.log("--------------------------------------------------");
Expand Down Expand Up @@ -68,6 +70,10 @@ const detectMissingFunctions = async () => {
"../doc-surrealql_versioned_docs/version-latest/functions/database/*.mdx"
);
for await (const path of glob.scan(".")) {
if (path.endsWith("index.mdx")) {
continue;
}

const data = await Bun.file(path).text();
const $ = cheerio.load(data);

Expand All @@ -78,7 +84,8 @@ const detectMissingFunctions = async () => {
.replace("()", "")
.replace(/\u200B/g, "")
)
.get();
.get()
.filter((functionName) => !fncExclusions.includes(functionName));

allDocumentedFunctions.push(...functionNames);
}
Expand Down

0 comments on commit 293bf92

Please sign in to comment.