Skip to content

Commit

Permalink
Update plugin kotlin-multiplatform to v1.6.10 (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
juul-mobile-bot authored Jan 11, 2022
1 parent 5dbe0f3 commit b6f935f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ not be executed concurrently.
```kotlin
database.writeTransaction("customers") {
val store = objectStore("customers")
store.add(jsObject<Customer> { ssn = "333-33-3333"; name = "Alice"; age = 33; email = "[email protected]" })
store.add(jsObject<Customer> { ssn = "444-44-4444"; name = "Bill"; age = 35; email = "[email protected]" })
store.add(jsObject<Customer> { ssn = "555-55-5555"; name = "Charlie"; age = 29; email = "[email protected]" })
store.add(jsObject<Customer> { ssn = "666-66-6666"; name = "Donna"; age = 31; email = "[email protected]" })
store.add(jso<Customer> { ssn = "333-33-3333"; name = "Alice"; age = 33; email = "[email protected]" })
store.add(jso<Customer> { ssn = "444-44-4444"; name = "Bill"; age = 35; email = "[email protected]" })
store.add(jso<Customer> { ssn = "555-55-5555"; name = "Charlie"; age = 29; email = "[email protected]" })
store.add(jso<Customer> { ssn = "666-66-6666"; name = "Donna"; age = 31; email = "[email protected]" })
}
```

Expand Down
6 changes: 3 additions & 3 deletions core/src/jsMain/kotlin/Key.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.juul.indexeddb

import com.juul.indexeddb.external.IDBKeyRange
import kotlinext.js.jsObject
import kotlinext.js.jso
import kotlin.js.Date

private fun Array<dynamic>.validateKeyTypes() {
Expand All @@ -13,7 +13,7 @@ private fun Array<dynamic>.validateKeyTypes() {
}

public object AutoIncrement {
internal fun toJs(): dynamic = jsObject { autoIncrement = true }
internal fun toJs(): dynamic = jso { autoIncrement = true }
}

public class KeyPath private constructor(
Expand All @@ -25,7 +25,7 @@ public class KeyPath private constructor(

public constructor(path: String, vararg morePaths: String) : this(arrayOf(path, *morePaths))

internal fun toWrappedJs(): dynamic = jsObject { keyPath = if (paths.size == 1) paths[0] else paths }
internal fun toWrappedJs(): dynamic = jso { keyPath = if (paths.size == 1) paths[0] else paths }
internal fun toUnwrappedJs(): dynamic = if (paths.size == 1) paths[0] else paths
}

Expand Down
4 changes: 2 additions & 2 deletions core/src/jsMain/kotlin/Transaction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.juul.indexeddb
import com.juul.indexeddb.external.IDBCursor
import com.juul.indexeddb.external.IDBRequest
import com.juul.indexeddb.external.IDBTransaction
import kotlinext.js.jsObject
import kotlinext.js.jso
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
Expand Down Expand Up @@ -197,5 +197,5 @@ public class VersionChangeTransaction internal constructor(
}

public fun ObjectStore.createIndex(name: String, keyPath: KeyPath, unique: Boolean): Index =
Index(objectStore.createIndex(name, keyPath.toUnwrappedJs(), jsObject { this.unique = unique }))
Index(objectStore.createIndex(name, keyPath.toUnwrappedJs(), jso { this.unique = unique }))
}
6 changes: 3 additions & 3 deletions core/src/jsTest/kotlin/KeyTests.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.juul.indexeddb

import com.juul.indexeddb.external.IDBKeyRange
import kotlinext.js.jsObject
import kotlinext.js.jso
import kotlin.js.Date
import kotlin.test.Test
import kotlin.test.assertFails
Expand All @@ -10,12 +10,12 @@ public class KeyTests {

@Test
public fun constructor_withObjectType_shouldFail() {
assertFails { Key(jsObject()) }
assertFails { Key(jso()) }
}

@Test
public fun constructor_withArrayOfObjectType_shouldFail() {
assertFails { Key(arrayOf<dynamic>(jsObject())) }
assertFails { Key(arrayOf<dynamic>(jso())) }
}

@Test
Expand Down
10 changes: 5 additions & 5 deletions core/src/jsTest/kotlin/Samples.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.juul.indexeddb

import kotlinext.js.jsObject
import kotlinext.js.jso
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.map
import kotlin.test.Test
Expand Down Expand Up @@ -35,10 +35,10 @@ class Samples {

database.writeTransaction("customers") {
val store = objectStore("customers")
store.add(jsObject<Customer> { ssn = "333-33-3333"; name = "Alice"; age = 33; email = "[email protected]" })
store.add(jsObject<Customer> { ssn = "444-44-4444"; name = "Bill"; age = 35; email = "[email protected]" })
store.add(jsObject<Customer> { ssn = "555-55-5555"; name = "Charlie"; age = 29; email = "[email protected]" })
store.add(jsObject<Customer> { ssn = "666-66-6666"; name = "Donna"; age = 31; email = "[email protected]" })
store.add(jso<Customer> { ssn = "333-33-3333"; name = "Alice"; age = 33; email = "[email protected]" })
store.add(jso<Customer> { ssn = "444-44-4444"; name = "Bill"; age = 35; email = "[email protected]" })
store.add(jso<Customer> { ssn = "555-55-5555"; name = "Charlie"; age = 29; email = "[email protected]" })
store.add(jso<Customer> { ssn = "666-66-6666"; name = "Donna"; age = 31; email = "[email protected]" })
}

val bill = database.transaction("customers") {
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
coroutines = "1.5.2"
extensions = "1.0.1-pre.264-kotlin-1.5.31"
kotlin = "1.5.31"
extensions = "1.0.1-pre.290-kotlin-1.6.10"
kotlin = "1.6.10"

[libraries]
coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
Expand Down

0 comments on commit b6f935f

Please sign in to comment.