From d064f5ba5cc2fa592c0e7566560b05e9c4ed65dc Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 24 Feb 2024 15:47:19 -0300 Subject: Normalize how modules import and name each other Also add a `defaultInterceptors` variable in `src/hero.mjs` to avoid needing to redefine it in every application. --- src/accretion.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/accretion.mjs') diff --git a/src/accretion.mjs b/src/accretion.mjs index 117e291..a9adb97 100644 --- a/src/accretion.mjs +++ b/src/accretion.mjs @@ -5,7 +5,7 @@ import url from "node:url"; import sqlite from "./sqlite.cjs"; -import { difference, log } from "./utils.mjs"; +import * as u from "./utils.mjs"; const DIRNAME = path.dirname(url.fileURLToPath(import.meta.url)); @@ -25,12 +25,12 @@ export const runMigrations = async db => { const done = [...(await db.all("SELECT filename FROM migrations;"))] .map(row => row.filename); const allFiles = fs.readdirSync(MIGRATIONS_DIR, "UTF-8"); - const pending = difference(new Set(allFiles), new Set(done)); + const pending = u.difference(new Set(allFiles), new Set(done)); const sortedPending = [...pending] .sort((a, b) => a.localeCompare(b, "POSIX")); for (const filename of sortedPending) { - log({ log: "exec-migration", filename }); + u.log({ log: "exec-migration", filename }); const sql = fs.readFileSync(MIGRATIONS_DIR + filename, "UTF-8"); await db.exec("BEGIN TRANSACTION;"); await db.exec(sql); -- cgit v1.2.3