Type guard to check if an assembly is of a specific type.
Use this to narrow the type of an assembly for type-safe property access.
The assembly to check
The expected assembly type
True if assembly matches the specified type
const { assembly } = useSmartObject();if (assertAssemblyType(assembly, Assemblies.SmartStorageUnit)) { // TypeScript knows assembly is SmartStorageUnit here console.log(assembly.storage.mainInventory);} Copy
const { assembly } = useSmartObject();if (assertAssemblyType(assembly, Assemblies.SmartStorageUnit)) { // TypeScript knows assembly is SmartStorageUnit here console.log(assembly.storage.mainInventory);}
Type guard to check if an assembly is of a specific type.
Use this to narrow the type of an assembly for type-safe property access.