import { getSheetForSyncing } from "./getSheetForSyncing" ; import { createHighlightEditedCellsRule } from "./createHighlightEditedCellsRule" ; export function isHighlightEditedCellsEnabled ( ) { const sheet = getSheetForSyncing ( ) ; if ( sheet !== null ) { const rules = sheet . getConditionalFormatRules ( ) ; const rule = createHighlightEditedCellsRule ( ) ; return rules . filter ( ( currentRule ) : boolean => { return currentRule . getBooleanCondition ( ) . getCriteriaValues ( ) [ 0 ] === rule . getBooleanCondition ( ) . getCriteriaValues ( ) [ 0 ] ; } ) . length > 0 ; } else { throw new Error ( "Document has not yet set up for syncing." ) ; } }