Skip to content

Commit

Permalink
refactor: rework VARIABLES_OPTIONS for drafts
Browse files Browse the repository at this point in the history
  • Loading branch information
loicguillois committed Dec 5, 2024
1 parent 89666ab commit 7e706a2
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions packages/models/src/variable-options.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
export type VariableOption =
| '{{owner.fullName}}'
| '{{housing.rawAddress}}'
| '{{housing.localId}}'
| '{{housing.invariant}}'
| '{{housing.cadastralReference}}'
| '{{housing.housingKind}}'
| '{{housing.livingArea}}'
| '{{housing.roomsCount}}'
| '{{housing.buildingYear}}'
| '{{housing.vacancyStartYear}}'
| '{{housing.energyConsumption}}';

const VARIABLES_OPTIONS: VariableOption[] = [
const VARIABLES_OPTIONS = [
'{{owner.fullName}}',
'{{housing.rawAddress}}',
'{{housing.localId}}',
Expand All @@ -25,6 +12,8 @@ const VARIABLES_OPTIONS: VariableOption[] = [
'{{housing.energyConsumption}}',
];

export type VariableOption = typeof VARIABLES_OPTIONS[number];

export function isVariableOption(value: string): value is VariableOption {
return VARIABLES_OPTIONS.find((option) => option === value) !== undefined;
}
Expand Down

0 comments on commit 7e706a2

Please sign in to comment.