Skip to content

Commit

Permalink
Merge branch 'fix-js'
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneeVandervelde committed Dec 30, 2023
2 parents 3031471 + 2a08833 commit e5b198c
Show file tree
Hide file tree
Showing 5 changed files with 2,012 additions and 14 deletions.
22 changes: 11 additions & 11 deletions buildSrc/src/main/kotlin/multiplatform.tier1.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ repositories {
kotlin {
jvmToolchain(11)
jvm()
// js(IR) {
// nodejs()
// browser()
// browser {
// testTask {
// useKarma {
// useFirefoxHeadless()
// }
// }
// }
// }
js(IR) {
nodejs()
browser()
browser {
testTask {
useKarma {
useFirefoxHeadless()
}
}
}
}
macosX64()
macosArm64()
iosSimulatorArm64()
Expand Down
6 changes: 4 additions & 2 deletions client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
plugins {
id("multiplatform.tier1")
kotlin("multiplatform")
id("ink.publishing")
}

kotlin {
jvmToolchain(11)
jvm()

sourceSets {
val commonMain by getting {
dependencies {
Expand Down
2 changes: 1 addition & 1 deletion codec/coverage.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"total": 29233,
"failed": 0,
"unknown": 3057
"unknown": 3060
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package com.inkapplications.ack.codec.position

import com.inkapplications.ack.codec.chunk.Chunk
import com.inkapplications.ack.codec.chunk.Chunker
import com.inkapplications.ack.structures.Symbol
import com.inkapplications.ack.structures.symbolOf
import inkapplications.spondee.spatial.GeoCoordinates
import inkapplications.spondee.spatial.longitude

/**
* Parse a compressed position.
Expand All @@ -16,6 +18,12 @@ internal object CompressedPositionChunker: Chunker<PositionReport.Compressed> {
val codeIdentifier = data[9]
val extension = CompressedExtraStringCodec.decodeExtra(data.slice(10..12))

Symbol.Schema.validate(codeIdentifier, tableIdentifier)
require(latitude.asDecimal >= -90.0 - 1e-10) { "Latitude cannot be less than -90 degrees." }
require(latitude.asDecimal <= 90.0 + 1e-10) { "Latitude cannot be greater than 90 degrees." }
require(longitude.asDecimal >= -180.0 - 1e-10) { "Latitude cannot be less than -180 degrees." }
require(longitude.asDecimal <= 180.0 + 1e-10) { "Latitude cannot be greater than 180 degrees." }

return Chunk(
result = PositionReport.Compressed(
coordinates = GeoCoordinates(latitude, longitude),
Expand Down
Loading

0 comments on commit e5b198c

Please sign in to comment.