You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

12 lines
426 B

import PhoneNumberMatcher from './PhoneNumberMatcher.js'
import normalizeArguments from './normalizeArguments.js'
export default function findPhoneNumbersInText() {
const { text, options, metadata } = normalizeArguments(arguments)
const matcher = new PhoneNumberMatcher(text, { ...options, v2: true }, metadata)
const results = []
while (matcher.hasNext()) {
results.push(matcher.next())
}
return results
}