Skip to content

Commit 04d29c1

Browse files
authored
Replace usages of deprecated jsObject with jso (#241)
1 parent 10c2685 commit 04d29c1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

core/src/jsMain/kotlin/Bluetooth.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import com.juul.kable.Options.Filter.Name
44
import com.juul.kable.Options.Filter.NamePrefix
55
import com.juul.kable.Options.Filter.Services
66
import com.juul.kable.external.Bluetooth
7-
import kotlinext.js.jsObject
7+
import kotlinext.js.jso
88
import kotlinx.coroutines.CoroutineScope
99
import kotlin.js.Promise
1010

@@ -44,20 +44,20 @@ public fun CoroutineScope.requestPeripheral(
4444
* ```
4545
*/
4646
private fun Options.toDynamic(): dynamic = if (filters == null) {
47-
jsObject {
47+
jso {
4848
this.acceptAllDevices = true
4949
this.optionalServices = optionalServices
5050
}
5151
} else {
52-
jsObject {
52+
jso {
5353
this.optionalServices = optionalServices
5454
this.filters = filters.map { it.toDynamic() }.toTypedArray()
5555
}
5656
}
5757

5858
private fun Options.Filter.toDynamic(): dynamic =
5959
when (this) {
60-
is Name -> jsObject { this.name = name }
61-
is NamePrefix -> jsObject { this.namePrefix = namePrefix }
62-
is Services -> jsObject { this.services = services }
60+
is Name -> jso { this.name = name }
61+
is NamePrefix -> jso { this.namePrefix = namePrefix }
62+
is Services -> jso { this.services = services }
6363
}

0 commit comments

Comments
 (0)