import { Alias } from '../types' ; export function alias ( name , abbreviation ? ) { return new ReginnAlias ( replaceDash ( name ) , replaceDash ( abbreviation || name ) ) ; } class ReginnAlias implements Alias { public type : 'alias' = 'alias' ; public name : string ; public abbreviation : string ; constructor ( name , abbreviation ) { this . name = name ; this . abbreviation = abbreviation ; } } function replaceDash ( str ) { return str . replace ( '/-+/' , '' ) ; }