relq 1.0.15 → 1.0.16

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.
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -106,16 +106,26 @@ function defineConfig(config) {
106
106
  };
107
107
  }
108
108
  async function loadConfig(startPath) {
109
- const result = findConfigFile(startPath);
110
- if (!result) {
111
- console.log("[loadConfig] No config file found");
109
+ const { existsSync, statSync } = require("fs");
110
+ const { dirname } = require("path");
111
+ let configPath = null;
112
+ if (startPath && existsSync(startPath)) {
113
+ const stats = statSync(startPath);
114
+ if (stats.isFile()) {
115
+ configPath = startPath;
116
+ } else {
117
+ const result = findConfigFile(startPath);
118
+ configPath = result?.configPath ?? null;
119
+ }
120
+ } else {
121
+ const result = findConfigFile();
122
+ configPath = result?.configPath ?? null;
123
+ }
124
+ if (!configPath) {
112
125
  return {};
113
126
  }
114
- console.log("[loadConfig] Found config at:", result.configPath);
115
127
  const jiti = (await import("jiti")).default("file:///Users/jmathew/Antigravity/kuery/src/config/config.ts");
116
- const module2 = await jiti.import(result.configPath, {});
117
- console.log("[loadConfig] jiti returned:", module2);
118
- console.log("[loadConfig] module.default:", module2?.default);
128
+ const module2 = await jiti.import(configPath, {});
119
129
  const config = module2?.default ?? module2;
120
130
  return config ?? {};
121
131
  }
@@ -36,16 +36,28 @@ export function defineConfig(config) {
36
36
  };
37
37
  }
38
38
  export async function loadConfig(startPath) {
39
- const result = findConfigFile(startPath);
40
- if (!result) {
41
- console.log('[loadConfig] No config file found');
39
+ const { existsSync, statSync } = require('fs');
40
+ const { dirname } = require('path');
41
+ let configPath = null;
42
+ if (startPath && existsSync(startPath)) {
43
+ const stats = statSync(startPath);
44
+ if (stats.isFile()) {
45
+ configPath = startPath;
46
+ }
47
+ else {
48
+ const result = findConfigFile(startPath);
49
+ configPath = result?.configPath ?? null;
50
+ }
51
+ }
52
+ else {
53
+ const result = findConfigFile();
54
+ configPath = result?.configPath ?? null;
55
+ }
56
+ if (!configPath) {
42
57
  return {};
43
58
  }
44
- console.log('[loadConfig] Found config at:', result.configPath);
45
59
  const jiti = (await import('jiti')).default(import.meta.url);
46
- const module = await jiti.import(result.configPath, {});
47
- console.log('[loadConfig] jiti returned:', module);
48
- console.log('[loadConfig] module.default:', module?.default);
60
+ const module = await jiti.import(configPath, {});
49
61
  const config = module?.default ?? module;
50
62
  return (config ?? {});
51
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relq",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "The Fully-Typed PostgreSQL ORM for TypeScript",
5
5
  "author": "Olajide Mathew O. <olajide.mathew@yuniq.solutions>",
6
6
  "license": "MIT",