import jsesc from 'jsesc' ; import { enumName } from './gen-utils' ; import { Options } from './options' ; /**
 * Represents a possible enumerated value
 */ export class EnumValue { name : string ; value : string ; constructor ( public type , name , _value , public options ) { const value = String ( _value ) ; this . name = name || enumName ( value , options ) ; if ( this . name === '' ) { this . name = '_' ; } if ( type === 'string' ) { this . value = `'${ jsesc ( value ) }'` ; } else { this . value = value ; } } }