import { None , Option } from "@siteimprove/alfa-option" ; const whitespace = /\s/ ; const digit = /\d/ ; /**
 * Parse the content attribute of a <meta http-equiv="refresh" content ="…" /> element
 * and return the time before the refresh occurs.
 *
 *  https export function getRefreshTime ( content ) { if ( content . length === 0 ) { return None ; } let i = 0 ; while ( whitespace . test ( content [ i ] ) ) { i ++ ; } const start = i ; while ( digit . test ( content [ i ] ) ) { i ++ ; } if ( start === i ) { return None ; } const next = content [ i ] ; if ( next !== undefined && next !== ";" && next !== "," ) { return None ; } return Option . of ( parseInt ( content . substring ( start , i ) , 10 ) ) ; }