cleanup
This commit is contained in:
parent
a976b60f20
commit
c9fac35ee3
|
@ -20,7 +20,7 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '14.x'
|
||||
node-version: 16
|
||||
- run: npm install -g firebase-tools
|
||||
- run: |
|
||||
cp .npmrc functions
|
||||
|
|
|
@ -22,7 +22,7 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '14.x'
|
||||
node-version: 16
|
||||
- run: npm install -g firebase-tools
|
||||
- name: build functions
|
||||
run: |
|
||||
|
|
|
@ -15,7 +15,7 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
node-version: 16
|
||||
- name: Check if version has been updated
|
||||
id: check
|
||||
uses: EndBug/version-check@v1
|
||||
|
|
|
@ -27,7 +27,7 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '12.x'
|
||||
node-version: 16
|
||||
- run: yarn install
|
||||
- run: yarn build
|
||||
- run: yarn test
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
ui-debug.log
|
||||
|
||||
# Compiled JavaScript files
|
||||
lib/**/*.js
|
||||
lib/**/*.js.map
|
||||
lib
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
|
|
@ -98,19 +98,22 @@ async function getRawEntries(): Promise<T.DictionaryEntry[]> {
|
|||
async function deleteRow(r: number) {
|
||||
await rows[r].delete();
|
||||
}
|
||||
const entries = makeEntries(rows, deleteRow);
|
||||
return entries;
|
||||
return await makeEntries(rows, deleteRow);
|
||||
}
|
||||
|
||||
function makeEntries(rows: any[], deleteRow: (r: number) => Promise<void>): T.DictionaryEntry[] {
|
||||
async function makeEntries(rows: any[], deleteRow: (r: number) => Promise<void>): Promise<T.DictionaryEntry[]> {
|
||||
const entries: T.DictionaryEntry[] = [];
|
||||
let sheetIndex = 0;
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
sheetIndex++;
|
||||
const row = rows[i];
|
||||
const nextRow = rows[i+1] || undefined;
|
||||
if (row.ts === nextRow?.ts) {
|
||||
if (row.p !== nextRow.p) throw new Error(`ts ${row.ts} is a duplicate of a different entry`);
|
||||
// this looks like a duplicate entry made by the sheets api
|
||||
// delete it and keep going
|
||||
deleteRow(i);
|
||||
await deleteRow(sheetIndex);
|
||||
sheetIndex--;
|
||||
continue;
|
||||
}
|
||||
const e: T.DictionaryEntry = {
|
||||
|
|
Loading…
Reference in New Issue