Add new mapper

This commit is contained in:
codewithearh 2025-12-25 22:21:25 +01:00
parent d733edb9b0
commit 9a0c9b9cb1
1 changed files with 24 additions and 0 deletions

View File

@ -86,3 +86,27 @@ func ExtractSelect(prop notionapi.Property) string {
} }
return "" return ""
} }
func ExtractFormula(prop notionapi.Property) notionapi.Formula {
if form, ok := prop.(*notionapi.FormulaProperty); ok {
return form.Formula
}
return notionapi.Formula{}
}
func ExtractFormulaText(prop notionapi.Property) string {
return ExtractFormula(prop).String
}
func ExtractFormulaBool(prop notionapi.Property) bool {
return ExtractFormula(prop).Boolean
}
func ExtractFormulaNumber(prop notionapi.Property) float64 {
return ExtractFormula(prop).Number
}
func ExtractFormulaDate(prop notionapi.Property) notionapi.DateObject {
return *ExtractFormula(prop).Date
}