refactor(rete): use asEntityId for AGG_FACT sentinel id
Drop the `-1 as unknown as EntityId` double-cast in favour of the asEntityId() helper exported alongside the type. Single-site, documented cast instead of an inline double-cast. Completes the cleanup of `as unknown as` in non-test source across both packages/chess and packages/rete.
This commit is contained in:
parent
a39b9921c6
commit
2643222373
1 changed files with 2 additions and 2 deletions
|
|
@ -62,7 +62,7 @@
|
||||||
* ExistentialNode upstream.
|
* ExistentialNode upstream.
|
||||||
*/
|
*/
|
||||||
import { Token, type Bindings } from "./beta.js";
|
import { Token, type Bindings } from "./beta.js";
|
||||||
import type { EntityId } from "./schema.js";
|
import { asEntityId } from "./schema.js";
|
||||||
import type { AttrKey, FactValue } from "./wm.js";
|
import type { AttrKey, FactValue } from "./wm.js";
|
||||||
|
|
||||||
/** Supported aggregator kinds. Extending this list requires a new case in
|
/** Supported aggregator kinds. Extending this list requires a new case in
|
||||||
|
|
@ -85,7 +85,7 @@ type DeactivateListener = (token: Token) => void;
|
||||||
* `schema.ts`), so there is no risk of collision.
|
* `schema.ts`), so there is no risk of collision.
|
||||||
*/
|
*/
|
||||||
const AGG_FACT = {
|
const AGG_FACT = {
|
||||||
id: -1 as unknown as EntityId,
|
id: asEntityId(-1),
|
||||||
attr: "__agg__" as AttrKey,
|
attr: "__agg__" as AttrKey,
|
||||||
value: null as FactValue,
|
value: null as FactValue,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue