@flowblade/sqlduck 0.24.0 → 0.25.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,6 +1,6 @@
|
|
|
1
1
|
import { getLogger } from "@logtape/logtape";
|
|
2
2
|
import fs from "node:fs";
|
|
3
|
-
import { basename, dirname } from "node:path";
|
|
3
|
+
import path, { basename, dirname } from "node:path";
|
|
4
4
|
//#region src/config/flowblade-logtape-sqlduck.config.ts
|
|
5
5
|
const flowbladeLogtapeSqlduckConfig = { categories: ["flowblade", "sqlduck"] };
|
|
6
6
|
//#endregion
|
|
@@ -85,8 +85,26 @@ var FileSystemUtils = class {
|
|
|
85
85
|
* Returns false if either path doesn't exist.
|
|
86
86
|
*/
|
|
87
87
|
isSamePath = (path1, path2) => {
|
|
88
|
+
if (typeof path1 !== "string" || typeof path2 !== "string" || path1.trim().length === 0 || path2.trim().length === 0) return false;
|
|
89
|
+
return path.resolve(path1) == path.resolve(path2);
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Check whether two paths (file, directory...) exists and are identical by comparing their real paths.
|
|
93
|
+
* Returns false if either path doesn't exist.
|
|
94
|
+
*/
|
|
95
|
+
isSamePathAndExists = (path1, path2) => {
|
|
96
|
+
if (typeof path1 !== "string" || typeof path2 !== "string" || path1.trim().length === 0 || path2.trim().length === 0) return false;
|
|
88
97
|
return fs.existsSync(path1) && fs.existsSync(path2) && fs.realpathSync(path1) === fs.realpathSync(path2);
|
|
89
98
|
};
|
|
99
|
+
/**
|
|
100
|
+
* Return directory and filename as absolute directory (cross-platform)
|
|
101
|
+
*/
|
|
102
|
+
join = (params) => {
|
|
103
|
+
const { dirname, filename } = params;
|
|
104
|
+
if (typeof dirname !== "string" || typeof filename !== "string" || dirname.trim().length === 0 || filename.trim().length === 0) throw new Error("dirname and filename parameters must be non empty string");
|
|
105
|
+
const combinedPath = path.join(dirname, filename);
|
|
106
|
+
return path.resolve(combinedPath);
|
|
107
|
+
};
|
|
90
108
|
};
|
|
91
109
|
//#endregion
|
|
92
110
|
export { sqlduckDefaultLogtapeLogger as n, flowbladeLogtapeSqlduckConfig as r, FileSystemUtils as t };
|
|
@@ -34,6 +34,18 @@ declare class FileSystemUtils {
|
|
|
34
34
|
* Returns false if either path doesn't exist.
|
|
35
35
|
*/
|
|
36
36
|
isSamePath: (path1: string, path2: string) => boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Check whether two paths (file, directory...) exists and are identical by comparing their real paths.
|
|
39
|
+
* Returns false if either path doesn't exist.
|
|
40
|
+
*/
|
|
41
|
+
isSamePathAndExists: (path1: string, path2: string) => boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Return directory and filename as absolute directory (cross-platform)
|
|
44
|
+
*/
|
|
45
|
+
join: (params: {
|
|
46
|
+
dirname: string;
|
|
47
|
+
filename: string;
|
|
48
|
+
}) => string;
|
|
37
49
|
}
|
|
38
50
|
//#endregion
|
|
39
51
|
export { FileSystemUtils };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as FileSystemUtils } from "../file-system-utils-
|
|
1
|
+
import { t as FileSystemUtils } from "../file-system-utils-DBihLfn2.mjs";
|
|
2
2
|
export { FileSystemUtils };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as sqlduckDefaultLogtapeLogger, r as flowbladeLogtapeSqlduckConfig, t as FileSystemUtils } from "./file-system-utils-
|
|
1
|
+
import { n as sqlduckDefaultLogtapeLogger, r as flowbladeLogtapeSqlduckConfig, t as FileSystemUtils } from "./file-system-utils-DBihLfn2.mjs";
|
|
2
2
|
import { t as duckReservedKeywords } from "./duck-reserved-keywords-D_yi_PVW.mjs";
|
|
3
3
|
import { c as duckValidatorsZod, r as assertValidAliasName, s as duckConnectionParamsZodSchema } from "./zod-uQPzaK64.mjs";
|
|
4
4
|
import { BIGINT, BOOLEAN, DOUBLE, DuckDBDataChunk, DuckDBInstanceCache, DuckDBTimestampMillisecondsValue, DuckDBTypeId, ENUM, FLOAT, HUGEINT, INTEGER, SMALLINT, TIMESTAMP, TIMESTAMP_MS, TINYINT, UBIGINT, UHUGEINT, UINTEGER, USMALLINT, UTINYINT, UUID, VARCHAR } from "@duckdb/node-api";
|