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