Skip to content

Commit

Permalink
Remove optionals
Browse files Browse the repository at this point in the history
  • Loading branch information
longzheng committed Feb 14, 2024
1 parent aa9ccf3 commit 327240f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class ScryptedDeviceBase extends DeviceBase {
getMediaObjectConsole(mediaObject: MediaObject): Console | undefined {
if (typeof mediaObject.sourceId !== 'string')
return this.console;
return deviceManager.getMixinConsole?.(mediaObject.sourceId, this.nativeId);
return deviceManager.getMixinConsole(mediaObject.sourceId, this.nativeId);
}

_lazyLoadDeviceState() {
Expand Down Expand Up @@ -115,7 +115,7 @@ export interface MixinDeviceOptions<T> {
constructor(options: MixinDeviceOptions<T>) {
super();

this.nativeId = systemManager.getDeviceById(this.id!)?.nativeId;
this.nativeId = systemManager.getDeviceById(this.id!).nativeId;
this.mixinDevice = options.mixinDevice;
this.mixinDeviceInterfaces = options.mixinDeviceInterfaces;
this.mixinStorageSuffix = options.mixinStorageSuffix;
Expand All @@ -125,7 +125,7 @@ export interface MixinDeviceOptions<T> {
// if the device state came from another node worker thread.
// This should ultimately be removed at some point in the future.
if ((this._deviceState as any).__rpcproxy_traps_all_properties && deviceManager.createDeviceState && typeof this._deviceState.id === 'string') {
this._deviceState = deviceManager.createDeviceState(this._deviceState.id, this._deviceState.setState!);
this._deviceState = deviceManager.createDeviceState(this._deviceState.id, this._deviceState.setState);
}
this.mixinProviderNativeId = options.mixinProviderNativeId;

Expand All @@ -143,7 +143,7 @@ export interface MixinDeviceOptions<T> {
getGet: (field: keyof DeviceState) => {
return () => {
this._lazyLoadDeviceState();
return this._deviceState?.[field];
return this._deviceState[field];
}
}
})
Expand Down Expand Up @@ -178,7 +178,7 @@ export interface MixinDeviceOptions<T> {
getMediaObjectConsole(mediaObject: MediaObject): Console | undefined {
if (typeof mediaObject.sourceId !== 'string')
return this.console;
return deviceManager.getMixinConsole?.(mediaObject.sourceId, this.mixinProviderNativeId);
return deviceManager.getMixinConsole(mediaObject.sourceId, this.mixinProviderNativeId);
}

/**
Expand Down

0 comments on commit 327240f

Please sign in to comment.