orchid-orm 1.5.20 → 1.5.21

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.
package/dist/index.mjs CHANGED
@@ -2314,16 +2314,22 @@ var __spreadValues = (a, b) => {
2314
2314
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
2315
2315
  class AppCodeUpdaterError extends Error {
2316
2316
  }
2317
- const appCodeUpdater = (config) => {
2317
+ const appCodeUpdater = ({
2318
+ tablePath,
2319
+ baseTablePath,
2320
+ baseTableName,
2321
+ mainFilePath
2322
+ }) => {
2318
2323
  return async ({ ast, options, basePath, cache: cacheObject }) => {
2319
- const params = __spreadProps(__spreadValues({}, config), {
2320
- baseTableName: config.baseTableName || "BaseTable",
2324
+ const params = {
2321
2325
  tablePath(name) {
2322
- const file = config.tablePath(name);
2323
- return path.isAbsolute(file) ? file : path.resolve(basePath, file);
2326
+ const file = tablePath(name);
2327
+ return resolvePath(basePath, file);
2324
2328
  },
2325
- mainFilePath: path.isAbsolute(config.mainFilePath) ? config.mainFilePath : path.resolve(basePath, config.mainFilePath)
2326
- });
2329
+ baseTablePath: resolvePath(basePath, baseTablePath),
2330
+ baseTableName: baseTableName || "BaseTable",
2331
+ mainFilePath: resolvePath(basePath, mainFilePath)
2332
+ };
2327
2333
  const promises = [
2328
2334
  updateMainFile(params.mainFilePath, params.tablePath, ast, options),
2329
2335
  updateTableFile(__spreadProps(__spreadValues({}, params), { ast }))
@@ -2339,6 +2345,7 @@ const appCodeUpdater = (config) => {
2339
2345
  await Promise.all(promises);
2340
2346
  };
2341
2347
  };
2348
+ const resolvePath = (basePath, filePath) => path.isAbsolute(filePath) ? filePath : path.resolve(basePath, filePath);
2342
2349
 
2343
2350
  export { AppCodeUpdaterError, appCodeUpdater, createBaseTable, createRepo, orchidORM };
2344
2351
  //# sourceMappingURL=index.mjs.map