mirror of
https://github.com/scummvm/scummvm-web.git
synced 2026-05-21 05:40:47 +00:00
DUMPER-COMPANION: More typing fixes
This commit is contained in:
@@ -37,7 +37,7 @@ async function dumpVolume(file: ArrayBuffer, s: DumpSettings): Promise<void> {
|
||||
s.log('2. Unzip the game data.');
|
||||
s.log('3. Add the directory to ScummVM.');
|
||||
} catch (err) {
|
||||
s.log(err);
|
||||
s.log(err as Error);
|
||||
}
|
||||
s.finished();
|
||||
}
|
||||
@@ -128,7 +128,7 @@ export default function Dumper() {
|
||||
log(`Loading volume "${image.name}"...`);
|
||||
const reader = new FileReader();
|
||||
reader.addEventListener('load', () => {
|
||||
dumpVolume(reader.result as ArrayBuffer, {
|
||||
void dumpVolume(reader.result as ArrayBuffer, {
|
||||
imageName: image.name,
|
||||
lang,
|
||||
unicode,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState } from 'preact/hooks';
|
||||
import * as punycode from 'punycode/';
|
||||
import * as punycode from 'punycode';
|
||||
import { escapeString, unescapeString } from './encoding';
|
||||
|
||||
export default function Punycoder() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as punycode from 'punycode/';
|
||||
import * as punycode from 'punycode';
|
||||
import { codePoint, byteToHex } from "./util";
|
||||
|
||||
|
||||
@@ -19,7 +19,9 @@ export enum Language {
|
||||
|
||||
|
||||
export function getLanguages(): string[] {
|
||||
return Object.keys(Language).map(key => Language[key]);
|
||||
return Object.keys(Language).map(
|
||||
// Typecast to string as the key obviously exists
|
||||
(key: string): string => Language[key] as string);
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +138,7 @@ export function decodeMacRoman(str: Uint8Array): string {
|
||||
*/
|
||||
|
||||
/* eslint-disable no-sparse-arrays */
|
||||
const macJapaneseMap = {
|
||||
const macJapaneseMap: Record<string, string[]> = {
|
||||
'81': [' ','、','。',',','.','・',':',';','?','!','゛','゜','´','`','¨','^',' ̄','_','ヽ','ヾ','ゝ','ゞ','〃','仝','々','〆','〇','ー','—','‐','/','\','〜','‖','|','…','‥','‘','’','“','”','(',')','〔','〕','[',']','{','}','〈','〉','《','》','「','」','『','』','【','】','+','−','±','×',,'÷','=','≠','<','>','≦','≧','∞','∴','♂','♀','°','′','″','℃','¥','$','¢','£','%','#','&','*','@','§','☆','★','○','●','◎','◇','◆','□','■','△','▲','▽','▼','※','〒','→','←','↑','↓','〓',,,,,,,,,,,,'∈','∋','⊆','⊇','⊂','⊃','∪','∩',,,,,,,,,'∧','∨','¬','⇒','⇔','∀','∃',,,,,,,,,,,,'∠','⊥','⌒','∂','∇','≡','≒','≪','≫','√','∽','∝','∵','∫','∬',,,,,,,,'Å','‰','♯','♭','♪','†','‡','¶',,,,,'◯'],
|
||||
'82': [,,,,,,,,,,,,,,,'0','1','2','3','4','5','6','7','8','9',,,,,,,,'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',,,,,,,,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',,,,,'ぁ','あ','ぃ','い','ぅ','う','ぇ','え','ぉ','お','か','が','き','ぎ','く','ぐ','け','げ','こ','ご','さ','ざ','し','じ','す','ず','せ','ぜ','そ','ぞ','た','だ','ち','ぢ','っ','つ','づ','て','で','と','ど','な','に','ぬ','ね','の','は','ば','ぱ','ひ','び','ぴ','ふ','ぶ','ぷ','へ','べ','ぺ','ほ','ぼ','ぽ','ま','み','む','め','も','ゃ','や','ゅ','ゆ','ょ','よ','ら','り','る','れ','ろ','ゎ','わ','ゐ','ゑ','を','ん'],
|
||||
'83': ['ァ','ア','ィ','イ','ゥ','ウ','ェ','エ','ォ','オ','カ','ガ','キ','ギ','ク','グ','ケ','ゲ','コ','ゴ','サ','ザ','シ','ジ','ス','ズ','セ','ゼ','ソ','ゾ','タ','ダ','チ','ヂ','ッ','ツ','ヅ','テ','デ','ト','ド','ナ','ニ','ヌ','ネ','ノ','ハ','バ','パ','ヒ','ビ','ピ','フ','ブ','プ','ヘ','ベ','ペ','ホ','ボ','ポ','マ','ミ',,'ム','メ','モ','ャ','ヤ','ュ','ユ','ョ','ヨ','ラ','リ','ル','レ','ロ','ヮ','ワ','ヰ','ヱ','ヲ','ン','ヴ','ヵ','ヶ',,,,,,,,,'Α','Β','Γ','Δ','Ε','Ζ','Η','Θ','Ι','Κ','Λ','Μ','Ν','Ξ','Ο','Π','Ρ','Σ','Τ','Υ','Φ','Χ','Ψ','Ω',,,,,,,,,'α','β','γ','δ','ε','ζ','η','θ','ι','κ','λ','μ','ν','ξ','ο','π','ρ','σ','τ','υ','φ','χ','ψ','ω'],
|
||||
@@ -204,7 +206,7 @@ export function decodeMacJapanese(str: Uint8Array, log: (string) => void): strin
|
||||
const hiKey = hi.toString(16);
|
||||
const loKey = lo - 0x40;
|
||||
|
||||
if (macJapaneseMap[hiKey] == null || macJapaneseMap[hiKey][loKey] == null) {
|
||||
if (!(hiKey in macJapaneseMap) || !(loKey in macJapaneseMap[hiKey])) {
|
||||
log(`Warning: No mapping for Mac Japanese sequence 0x${byteToHex(hi)}${byteToHex(lo)}, decoding as Mac Roman`);
|
||||
return decodeMacRoman(str);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user