File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import com.juul.kable.Options.Filter.Name
44import com.juul.kable.Options.Filter.NamePrefix
55import com.juul.kable.Options.Filter.Services
66import com.juul.kable.external.Bluetooth
7- import kotlinext.js.jsObject
7+ import kotlinext.js.jso
88import kotlinx.coroutines.CoroutineScope
99import kotlin.js.Promise
1010
@@ -44,20 +44,20 @@ public fun CoroutineScope.requestPeripheral(
4444 * ```
4545 */
4646private 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
5858private 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 }
You can’t perform that action at this time.
0 commit comments