@cosmicdrift/kumiko-framework 0.61.0 → 0.63.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-framework",
3
- "version": "0.61.0",
3
+ "version": "0.63.0",
4
4
  "description": "Framework core — engine, pipeline, API, DB, and every other bit that makes Kumiko go.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -61,7 +61,7 @@ function navById(id: string): NavDefinition | undefined {
61
61
  }
62
62
  function configScreen(id: string): ConfigEditScreenDefinition {
63
63
  const s: ScreenDefinition | undefined = schema.screens.find((x) => x.id === id);
64
- if (!s || s.type !== "configEdit") throw new Error(`no configEdit screen "${id}"`);
64
+ if (s?.type !== "configEdit") throw new Error(`no configEdit screen "${id}"`);
65
65
  return s;
66
66
  }
67
67
 
@@ -95,7 +95,7 @@ describe("locatedTimestamp(name) Helper", () => {
95
95
  for (const name of ["a", "x_y", "long_field_name"]) {
96
96
  const fields = locatedTimestamp(name);
97
97
  const at = fields[`${name}At`];
98
- if (!at || at.type !== "timestamp") throw new Error("at field missing");
98
+ if (at?.type !== "timestamp") throw new Error("at field missing");
99
99
  expect(at.locatedBy).toBe(`${name}Tz`);
100
100
  }
101
101
  });
@@ -129,7 +129,7 @@ export function validateProjectionAllowlist(features: readonly FeatureDefinition
129
129
  for (const f of features) {
130
130
  for (const [handlerName, handler] of Object.entries(f.writeHandlers)) {
131
131
  const perform = (handler as { readonly perform?: PipelineDef }).perform;
132
- if (!perform || perform.__kind !== "pipeline") continue;
132
+ if (perform?.__kind !== "pipeline") continue;
133
133
 
134
134
  let steps: readonly StepInstance[];
135
135
  try {
@@ -107,7 +107,7 @@ class NoopMeter implements Meter {
107
107
 
108
108
  counter(name: string): Counter {
109
109
  const def = this.defs.get(name);
110
- if (!def || def.type !== "counter") {
110
+ if (def?.type !== "counter") {
111
111
  throw new Error(`[Kumiko Observability] Counter "${name}" not registered or wrong type.`);
112
112
  }
113
113
  return this.counterInstance;
@@ -115,7 +115,7 @@ class NoopMeter implements Meter {
115
115
 
116
116
  histogram(name: string): Histogram {
117
117
  const def = this.defs.get(name);
118
- if (!def || def.type !== "histogram") {
118
+ if (def?.type !== "histogram") {
119
119
  throw new Error(`[Kumiko Observability] Histogram "${name}" not registered or wrong type.`);
120
120
  }
121
121
  return this.histogramInstance;
@@ -123,7 +123,7 @@ class NoopMeter implements Meter {
123
123
 
124
124
  gauge(name: string): Gauge {
125
125
  const def = this.defs.get(name);
126
- if (!def || def.type !== "gauge") {
126
+ if (def?.type !== "gauge") {
127
127
  throw new Error(`[Kumiko Observability] Gauge "${name}" not registered or wrong type.`);
128
128
  }
129
129
  return this.gaugeInstance;