{"version":3,"sources":["../../source/findNumbers/isValidPreCandidate.js"],"names":["SLASH_SEPARATED_DATES","TIME_STAMPS","TIME_STAMPS_SUFFIX_LEADING","isValidPreCandidate","candidate","offset","text","test","followingText","slice","length"],"mappings":"AAAA;AACA;AACA,IAAMA,qBAAqB,GAAG,mEAA9B,C,CAEA;AACA;AACA;AACA;;AACA,IAAMC,WAAW,GAAG,4CAApB;AACA,IAAMC,0BAA0B,GAAG,WAAnC;AAEA,eAAe,SAASC,mBAAT,CAA6BC,SAA7B,EAAwCC,MAAxC,EAAgDC,IAAhD,EACf;AACC;AACA,MAAIN,qBAAqB,CAACO,IAAtB,CAA2BH,SAA3B,CAAJ,EAA2C;AAC1C,WAAO,KAAP;AACA,GAJF,CAMC;;;AACA,MAAIH,WAAW,CAACM,IAAZ,CAAiBH,SAAjB,CAAJ,EACA;AACC,QAAMI,aAAa,GAAGF,IAAI,CAACG,KAAL,CAAWJ,MAAM,GAAGD,SAAS,CAACM,MAA9B,CAAtB;;AACA,QAAIR,0BAA0B,CAACK,IAA3B,CAAgCC,aAAhC,CAAJ,EAAoD;AACnD,aAAO,KAAP;AACA;AACD;;AAED,SAAO,IAAP;AACA","sourcesContent":["// Matches strings that look like dates using \"/\" as a separator.\r\n// Examples: 3/10/2011, 31/10/96 or 08/31/95.\r\nconst SLASH_SEPARATED_DATES = /(?:(?:[0-3]?\\d\\/[01]?\\d)|(?:[01]?\\d\\/[0-3]?\\d))\\/(?:[12]\\d)?\\d{2}/\r\n\r\n// Matches timestamps.\r\n// Examples: \"2012-01-02 08:00\".\r\n// Note that the reg-ex does not include the\r\n// trailing \":\\d\\d\" -- that is covered by TIME_STAMPS_SUFFIX.\r\nconst TIME_STAMPS = /[12]\\d{3}[-/]?[01]\\d[-/]?[0-3]\\d +[0-2]\\d$/\r\nconst TIME_STAMPS_SUFFIX_LEADING = /^:[0-5]\\d/\r\n\r\nexport default function isValidPreCandidate(candidate, offset, text)\r\n{\r\n\t// Skip a match that is more likely to be a date.\r\n\tif (SLASH_SEPARATED_DATES.test(candidate)) {\r\n\t\treturn false\r\n\t}\r\n\r\n\t// Skip potential time-stamps.\r\n\tif (TIME_STAMPS.test(candidate))\r\n\t{\r\n\t\tconst followingText = text.slice(offset + candidate.length)\r\n\t\tif (TIME_STAMPS_SUFFIX_LEADING.test(followingText)) {\r\n\t\t\treturn false\r\n\t\t}\r\n\t}\r\n\r\n\treturn true\r\n}"],"file":"isValidPreCandidate.js"}