JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q45844F
  • License MIT

elliptical phrase for matching a phone number

Package Exports

  • elliptical-phone

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (elliptical-phone) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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