收紧资源布局 revision IPC 精度边界
统一限制资源布局 revision 到 JavaScript 最大安全整数 在 Rust serde、Tauri 输入与前端 IPC 三层拒绝非安全 revision 补充最大值往返、上限失败、超限零副作用与不可信响应回归 同步更新资源画布合同、技术决策与竞态经验
This commit is contained in:
@@ -469,6 +469,18 @@ export interface GameCreationAppAssetManifestEntry {
|
||||
|
||||
export const GAME_CREATION_RESOURCE_LAYOUT_SCHEMA_VERSION =
|
||||
'game-creator-resource-layout.v1' as const;
|
||||
export const GAME_CREATION_RESOURCE_LAYOUT_MAX_SAFE_REVISION = 9_007_199_254_740_991;
|
||||
|
||||
export function isSafeProjectResourceCanvasLayoutRevision(
|
||||
value: unknown,
|
||||
): value is number {
|
||||
return (
|
||||
typeof value === 'number' &&
|
||||
Number.isSafeInteger(value) &&
|
||||
value >= 0 &&
|
||||
value <= GAME_CREATION_RESOURCE_LAYOUT_MAX_SAFE_REVISION
|
||||
);
|
||||
}
|
||||
|
||||
export type ProjectResourceCanvasLayoutMode = 'dependency' | 'type';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user