File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ const ok_signals = [...Array(3)].map((_, i) => i + 385);
140
140
export function watch_loop ( watch_fun , do_fun ) {
141
141
while ( true ) {
142
142
let result = watch_fun ( ) ;
143
- if ( result . isOk ( ) ) {
143
+ if ( result instanceof Ok ) {
144
144
do_fun ( ) ;
145
145
} else if ( ok_signals . includes ( result [ 0 ] [ 0 ] ) ) {
146
146
// Exit successfully on some signals.
@@ -170,15 +170,15 @@ export function decode_object(data) {
170
170
171
171
export function toml_decode_every ( toml , key_path , decoder ) {
172
172
let result = toml_get ( toml , key_path ) ;
173
- if ( ! result . isOk ( ) ) {
173
+ if ( result instanceof GleamError ) {
174
174
let decode_error = new DecodeError ( "field" , "nothing" , key_path ) ;
175
175
return new GleamError ( toList ( [ decode_error ] ) ) ;
176
176
}
177
177
toml = result [ 0 ] ;
178
178
let items = Object . keys ( toml )
179
179
. map ( ( key ) => {
180
180
let result = decoder ( toml [ key ] ) ;
181
- return [ key , result . isOk ( ) ? result [ 0 ] : Nil ] ;
181
+ return [ key , result instanceof Ok ? result [ 0 ] : Nil ] ;
182
182
} )
183
183
. filter ( ( [ _key , value ] ) => Nil !== value ) ;
184
184
return new Ok ( toList ( items ) ) ;
You can’t perform that action at this time.
0 commit comments