import { isMatch } from 'micromatch' ; import { BranchProtectionRule } from './listBranchProtectionRules' ; /**
 * Returns an array of booleans indicating whether the provided pull requests
 * require their branches to be up to date before merging.
 */ export const computeRequiresStrictStatusChecksForRefs = ( branchProtectionRules , refs ) : boolean [ ] => refs . map ( ( reference ) : boolean => branchProtectionRules . some ( ( { pattern , requiresStrictStatusChecks , } ) : boolean => isMatch ( reference , pattern ) && requiresStrictStatusChecks === true ) ) ;