Add position constants, reactor/settler config schemas
- New src/constants/positions.js: POSITIONS enum (upstream/downstream/atEquipment/delta) - New src/configs/reactor.json: Full schema for CSTR/PFR reactor parameters and ASM3 initial state - New src/configs/settler.json: Schema for settler node - Export POSITIONS, POSITION_VALUES, isValidPosition from index.js Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
18
src/constants/positions.js
Normal file
18
src/constants/positions.js
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Canonical position constants for parent-child relationships.
|
||||
* Use these instead of hardcoded strings throughout the codebase.
|
||||
*/
|
||||
const POSITIONS = Object.freeze({
|
||||
UPSTREAM: 'upstream',
|
||||
DOWNSTREAM: 'downstream',
|
||||
AT_EQUIPMENT: 'atEquipment',
|
||||
DELTA: 'delta',
|
||||
});
|
||||
|
||||
const POSITION_VALUES = Object.freeze(Object.values(POSITIONS));
|
||||
|
||||
function isValidPosition(pos) {
|
||||
return POSITION_VALUES.includes(pos);
|
||||
}
|
||||
|
||||
module.exports = { POSITIONS, POSITION_VALUES, isValidPosition };
|
||||
Reference in New Issue
Block a user