minify output of TCG indexer

This commit is contained in:
jogerj 2023-01-02 00:56:43 +01:00
parent 9d051b0c1d
commit 95586f3860
No known key found for this signature in database
GPG key ID: 23F7E978C8C660AE
3 changed files with 5 additions and 43374 deletions

View file

@ -8,7 +8,7 @@
"build": "cross-env NODE_OPTIONS=--max_old_space_size=4096 vite build",
"preview": "vite preview",
"start": "node build",
"index-tcg": "npx tsx scripts/tcgIndexer.ts"
"index-tcg": "tsx scripts/tcgIndexer.ts"
},
"devDependencies": {
"@andreekeberg/imagedata": "^1.0.2",

View file

@ -1,4 +1,4 @@
// Run with "npm run index-tcg"
// Run with "pnpm index-tcg"
import * as fs from 'fs';
import * as path from 'path';
import cv from 'opencv-ts';
@ -47,9 +47,9 @@ async function onRuntimeInitialized() {
"characters": charactersIndex,
"actions": actionsIndex
},
(k, v) => ArrayBuffer.isView(v) ? Array.from(v as unknown as ArrayLike<unknown>) : v, 2);
(k, v) => ArrayBuffer.isView(v) ? Array.from(v as unknown as ArrayLike<unknown>) : v, 0);
try {
fs.writeFileSync(indexFilename, "export const tcgIndex = " + cardsIndexJson);
fs.writeFileSync(indexFilename, "export const tcgIndex=" + cardsIndexJson);
console.log(`Saved index data to ${indexFilename}`);
} catch (err) {
console.error(err);

File diff suppressed because one or more lines are too long