From 9ee16463e8d0208ba2578e0bc5bc24f369bba4f9 Mon Sep 17 00:00:00 2001 From: adueck Date: Tue, 6 Aug 2024 16:30:59 -0400 Subject: [PATCH] fix build error that occurs with new node version --- .github/workflows/ci.yml | 2 +- .github/workflows/publish.yml | 2 +- check-all-inflections.ts | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62e6da3..cdefbc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 16 cache: "yarn" - name: Install, build, test run: | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 76a0d26..23fdbe3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 16 cache: "yarn" - name: Check if version has been updated id: check diff --git a/check-all-inflections.ts b/check-all-inflections.ts index 787c4d7..9e7d791 100644 --- a/check-all-inflections.ts +++ b/check-all-inflections.ts @@ -1,5 +1,6 @@ import * as T from "./src/types"; import { inflectWord } from "./src/lib/src/pashto-inflector"; +import * as tp from "./src/lib/src/type-predicates"; // Script to try inflecting all the words in the dictionary and make sure that // no errors are thrown in the process @@ -27,6 +28,19 @@ async function checkAll() { err: e.toString(), }); } + if (tp.isVerbEntry(entry)) { + const complement = entry.l + ? entries.find((e) => e.ts === entry.l) + : undefined; + if (entry.l && !complement) { + errors.push({ + ts: entry.ts, + p: entry.p, + f: entry.f, + err: "verb complement missing", + }); + } + } }); return errors; }