Skip to content

Commit fdd1a01

Browse files
committed
.
1 parent 6e8b851 commit fdd1a01

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

scautable/src-js/JsonStub.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@ package io.github.quafadas.scautable.json
22

33
object JsonTable:
44

5-
6-
7-
end JsonTable
5+
end JsonTable

scautable/src-jvm/JsonTable.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ object JsonTable:
259259
val path = $pathExpr
260260
val resourceUrl = this.getClass.getClassLoader.getResource(path)
261261
if resourceUrl == null then throw new RuntimeException(s"Resource not found: $path")
262+
end if
262263
val inputStream = resourceUrl.openStream()
263264
val objects = StreamingJsonParser.parseArrayStream(inputStream)
264265
new JsonIterator[Hdrs, Data](objects, ${ Expr.ofSeq(headers.map(Expr(_))) }.toSeq)
@@ -320,8 +321,8 @@ object JsonTable:
320321

321322
/** Creates a function that reads a JSON file from a runtime path and returns a [[JsonIterator]].
322323
*
323-
* Unlike other JSON methods that require the file path at compile time, this method allows you to specify the column types at compile time but provide the file path at runtime. This is useful when
324-
* you know the structure of a JSON file in advance but the actual file location is determined at runtime.
324+
* Unlike other JSON methods that require the file path at compile time, this method allows you to specify the column types at compile time but provide the file path at runtime.
325+
* This is useful when you know the structure of a JSON file in advance but the actual file location is determined at runtime.
325326
*
326327
* Example:
327328
* {{{
@@ -345,6 +346,7 @@ object JsonTable:
345346
// Peek at first object to validate headers match expected
346347
val bufferedObjects = objects.buffered
347348
if !bufferedObjects.hasNext then throw new IllegalStateException(s"JSON file at ${path.toString} contains no objects")
349+
end if
348350

349351
val firstObj = bufferedObjects.head
350352
val actualHeaders = firstObj.fields.keys.toSeq

0 commit comments

Comments
 (0)