Skip to content

Commit

Permalink
fix: Typing
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlaa committed May 15, 2024
1 parent ab403c4 commit e4c882c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion source/migrations/migrateSituation/getValueWithoutQuotes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function getValueWithoutQuotes(value: string | number) {
import { NodeValue } from '../../../types/types'

export function getValueWithoutQuotes(value: NodeValue) {
if (
typeof value !== 'string' ||
!value.startsWith("'") ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function getMigratedValue({
ruleName: DottedName
nodeValue: NodeValue
migrationInstructions: MigrationType
}): string | number {
}): NodeValue {
if (
typeof migrationInstructions.valuesToMigrate[ruleName][
nodeValue as string
Expand Down
6 changes: 3 additions & 3 deletions types/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Evaluation } from 'publicodes'

export type NodeValue = Evaluation

export type Situation = {
[key: string]: string | number
[key: string]: NodeValue
}

export type DottedName = string
Expand All @@ -10,5 +12,3 @@ export type MigrationType = {
keysToMigrate: Record<DottedName, DottedName>
valuesToMigrate: Record<DottedName, Record<string, NodeValue>>
}

export type NodeValue = Evaluation

0 comments on commit e4c882c

Please sign in to comment.