homura-runtime 0.2.10 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 64648aa358cfa6cd1c65fff6da71068b244c136017c896aa002308eb391a571b
4
- data.tar.gz: 7c02ed80302c02f183e7927c9bd15c25dc1389a2e3921ebbc7bd60cc2622a574
3
+ metadata.gz: 7426d1447a4eca3f4ae0b8826e8dfaee809c9868d99314e381ae5b0e338defc3
4
+ data.tar.gz: d42df70713ac5bf410d91ccd77ade2c3500464a2280c769ee5475449ce427231
5
5
  SHA512:
6
- metadata.gz: 2d41fbab3ad2faef7a283e824f66918fbbeb71ce38b3c82597109df9d69cdb5b7f7e89ddb6beca6aa1965f71e26c1791d44019b46217eebfdb6760b9daddac1e
7
- data.tar.gz: ad1208ab207ed735d5effacb6f26a4df562652cf0f53e96acee461e7d6c4fdc397cb5d46016e515077bf0c84065918e6daae29e378a000a0b279b062fe061e1e
6
+ metadata.gz: f92aca6718eeb4440a60a45611378e0fa4669116fbe56f56f4663705f6440e9010e92d9d30f09c5faac5b2d7de47798a2c26dba69f9995012ce655b861831c9e
7
+ data.tar.gz: 9686bae18cd4c9f858f8056c807d47e068130710b44d73b796b21119b102a176f9c5154f9f5e40b95f0e4b5c6a846e6b37a16a00677c208820cef5263c7b4e27
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.11 (2026-04-25)
4
+
5
+ - Normalize bare JS `undefined` / `null` values to Ruby `nil` while converting
6
+ D1 rows into Ruby Hashes, preventing first-row crashes when a nullable column
7
+ is present in the result shape.
8
+
3
9
  ## 0.2.10 (2026-04-24)
4
10
 
5
11
  - Derive `worker.entrypoint.mjs` import paths relative to the actual
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudflareWorkers
4
- VERSION = '0.2.10'
4
+ VERSION = '0.2.11'
5
5
  end
@@ -504,8 +504,13 @@ module Cloudflare
504
504
  while i < len
505
505
  k = `#{keys}[#{i}]`
506
506
  v = `#{js_obj}[#{k}]`
507
+ # Normalize bare JS null/undefined to Ruby nil before storing them.
508
+ if `#{v} == null`
509
+ v = nil
507
510
  # Recurse for nested plain objects (but not Arrays, Dates, etc.)
508
- v = js_object_to_hash(v) if `typeof #{v} === 'object' && #{v} != null && !Array.isArray(#{v}) && !(#{v} instanceof Date)`
511
+ elsif `typeof #{v} === 'object' && !Array.isArray(#{v}) && !(#{v} instanceof Date)`
512
+ v = js_object_to_hash(v)
513
+ end
509
514
  h[k] = v
510
515
  i += 1
511
516
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homura-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuhiro Homma