Skip to content
This repository has been archived by the owner on Dec 17, 2022. It is now read-only.

brandonhorst/elliptical-phone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lacona-phrase-phone-number

Build Status

Lacona Phrases for matching phone numbers

Installation

npm install lacona-phrase-phone-number

Usage

/** @jsx createElement */
import { createElement, Phrase } from 'lacona-phrase'
import { PhoneNumber } from 'lacona-phrase-phone-number'
import { Parser } from 'lacona'

const parser = new Parser({
  grammar: (
    <sequence>
      <literal text='call ' />
      <PhoneNumber />
    </sequence>
  )
})

parser.parseArray('call +1 617 8675309')
/* [{
  words: [
    {text: 'call ', input: true},
    {text: '+1 617 8675309', input: true, argument='phone number'}
}] */

Reference

PhoneNumber

Matches standard phone numbers. These can optional start with a +, and then can have parenthesis and dashes. The actual structure is not mandated.

Result

String - the phone numbers, as input (with +, parens, dashes, and all)

Props

  • argument: String - the text for the label

About

Lacona Phrase for allowing the input of Phone Numbers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published