@lancedb/lancedb 0.18.0 → 0.18.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,68 +0,0 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
-
4
- // Read all files in the directory
5
- function processDirectory(directoryPath) {
6
- fs.readdir(directoryPath, { withFileTypes: true }, (err, files) => {
7
- if (err) {
8
- return console.error("Unable to scan directory: " + err);
9
- }
10
-
11
- files.forEach((file) => {
12
- const filePath = path.join(directoryPath, file.name);
13
-
14
- if (file.isDirectory()) {
15
- // Recursively process subdirectory
16
- processDirectory(filePath);
17
- } else if (file.isFile()) {
18
- // Read each file
19
- fs.readFile(filePath, "utf8", (err, data) => {
20
- if (err) {
21
- return console.error("Unable to read file: " + err);
22
- }
23
-
24
- // Process the file content
25
- const processedData = processContents(data);
26
-
27
- // Write the processed content back to the file
28
- fs.writeFile(filePath, processedData, "utf8", (err) => {
29
- if (err) {
30
- return console.error("Unable to write file: " + err);
31
- }
32
- console.log(`Processed file: ${filePath}`);
33
- });
34
- });
35
- }
36
- });
37
- });
38
- }
39
-
40
- function processContents(contents) {
41
- // This changes the parameters section to put the parameter description on
42
- // the same line as the bullet with the parameter name and type.
43
- return (
44
- contents
45
- .replace(/(## Parameters[\s\S]*?)(?=##|$)/g, (match) => {
46
- let lines = match
47
- .split("\n")
48
- .map((line) => line.trim())
49
-
50
- .filter((line) => line !== "")
51
- .map((line) => {
52
- if (line.startsWith("##")) {
53
- return line;
54
- } else if (line.startsWith("•")) {
55
- return "\n*" + line.substring(1);
56
- } else {
57
- return " " + line;
58
- }
59
- });
60
- return lines.join("\n") + "\n\n";
61
- })
62
- // Also trim trailing whitespace
63
- .replace(/([^ \t])[ \t]+\n/g, "$1\n")
64
- );
65
- }
66
-
67
- // Start processing from the root directory
68
- processDirectory("../docs/src/js");