Add new mapper
This commit is contained in:
parent
d733edb9b0
commit
9a0c9b9cb1
24
mapper.go
24
mapper.go
|
|
@ -86,3 +86,27 @@ func ExtractSelect(prop notionapi.Property) string {
|
|||
}
|
||||
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue