File tree 4 files changed +6
-6
lines changed
4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export async function build(): Promise<boolean> {
36
36
const endDictionary = performance . now ( ) ;
37
37
let dictionary : Dictionary ;
38
38
if ( ! result . isError ( ) ) {
39
- dictionary = result . array [ 0 ] ;
39
+ dictionary = result . unwrap ( ) [ 0 ] ;
40
40
} else {
41
41
displayError ( text , result . errors ) ;
42
42
return false ;
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ function main(): void {
180
180
181
181
// load custom dictionary
182
182
if ( ! currentDictionary . isError ( ) ) {
183
- loadCustomDictionary ( currentDictionary . array [ 0 ] ) ;
183
+ loadCustomDictionary ( currentDictionary . unwrap ( ) [ 0 ] ) ;
184
184
} else {
185
185
showDictionaryError ( ) ;
186
186
showMessage ( DICTIONARY_LOADING_FAILED_MESSAGE ) ;
@@ -240,7 +240,7 @@ function main(): void {
240
240
errorDisplay . innerText = "" ;
241
241
const result = translate ( inputTextBox . value ) ;
242
242
if ( ! result . isError ( ) ) {
243
- for ( const translation of result . array ) {
243
+ for ( const translation of result . unwrap ( ) ) {
244
244
const list = document . createElement ( "li" ) ;
245
245
list . innerHTML = translation ;
246
246
outputList . appendChild ( list ) ;
@@ -350,7 +350,7 @@ function main(): void {
350
350
if ( ! currentDictionary . isError ( ) ) {
351
351
lastSavedText = customDictionaryTextBox . value ;
352
352
lastSavedDictionary = currentDictionary ;
353
- loadCustomDictionary ( currentDictionary . array [ 0 ] ) ;
353
+ loadCustomDictionary ( currentDictionary . unwrap ( ) [ 0 ] ) ;
354
354
setIgnoreError ( DICTIONARY_KEY , customDictionaryTextBox . value ) ;
355
355
customDictionaryDialogBox . close ( ) ;
356
356
} else {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ if (import.meta.main) {
20
20
// deno-lint-ignore no-console
21
21
console . error ( new AggregateError ( result . errors ) ) ;
22
22
} else {
23
- const translations = result . array ;
23
+ const translations = result . unwrap ( ) ;
24
24
for ( const translation of translations ) {
25
25
const count = translation . match ( / < s t r o n g > / g) ?. length ?? 0 ;
26
26
const text = unescape (
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export function translate(tokiPona: string): ArrayResult<string> {
14
14
. flatMap ( multipleSentences )
15
15
. map ( EnglishComposer . multipleSentences ) ;
16
16
if ( ! arrayResult . isError ( ) ) {
17
- const values = distinct ( arrayResult . array ) ;
17
+ const values = distinct ( arrayResult . unwrap ( ) ) ;
18
18
if ( settings . randomize ) {
19
19
return new ArrayResult ( shuffle ( values ) ) ;
20
20
} else {
You can’t perform that action at this time.
0 commit comments