@onlyworlds/sdk 4.42.3 → 4.42.4

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.42.4] - 2026-10-21
9
+
10
+ ### Fixed
11
+ - **`parseDate` refuses a date the typed era does not hold**, rather than reading its number as an absolute year in another era. With a down era Before Gate turning on 6 Frost, "10 Thaw, 1 BG" read as step 39 ("10 Thaw, 2 AG") and "3 Frost, 0 BG" as "3 Frost, 1 BG"; both now answer `not a date in Before Gate`. The absolute reading stays for a step in no era, where `formatStep` prints the absolute year. No date `formatStep` prints changes how it parses: 20,826 round trips over the profile fixture's calendars read the same before and after. Found by Temper in Atlas 1.67.1 (OW Council h58 #9304).
12
+
8
13
  ## [4.42.3] - 2026-10-21
9
14
 
10
15
  ### Fixed
package/dist/index.js CHANGED
@@ -3348,7 +3348,11 @@ function parseDate(cfg, input, opts = {}) {
3348
3348
  const viaEra = resolveInYear(absYearForEraYear(cfg, target, year));
3349
3349
  if (isParseError(viaEra)) return viaEra;
3350
3350
  if (eraForStep(cfg, viaEra.step) === target) return viaEra;
3351
- return resolveInYear(year);
3351
+ const viaAbs = resolveInYear(year);
3352
+ if (era && !isParseError(viaAbs) && eraForStep(cfg, viaAbs.step) !== null) {
3353
+ return { error: `not a date in ${era.name}` };
3354
+ }
3355
+ return viaAbs;
3352
3356
  }
3353
3357
  function isParseError(r) {
3354
3358
  return r.error !== void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.42.3",
3
+ "version": "4.42.4",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {