export type StringAnyMap = { [ key ] : any ; } ; export class Dictionary < T > { private store : { [ key ] : T ; } = { } ; constructor ( attrs ? ) { if ( attrs ) { for ( const key in attrs ) { this . set ( key , attrs [ key ] ) ; } } } set ( key , value ) { const retVal = this . store [ key ] ; this . store [ key ] = value ; return retVal ; } get ( key ) { return this . store [ key ] ; } has ( key ) { return this . store [ key ] !== undefined ; } remove ( key ) { delete this . store [ key ] ; } keys ( ) { const retVal = [ ] ; for ( const key in this . store ) { retVal . push ( key ) ; } return retVal ; } values ( ) { const retVal = [ ] ; for ( const key in this . store ) { retVal . push ( this . store [ key ] ) ; } return retVal ; } } export class DictionaryNoCase < T > extends Dictionary < T > { constructor ( attrs ? ) { super ( attrs ) ; } set ( key , value ) { return super . set ( key . toLowerCase ( ) , value ) ; } get ( key ) { return super . get ( key . toLowerCase ( ) ) ; } has ( key ) { return super . has ( key . toLowerCase ( ) ) ; } remove ( key ) { return super . remove ( key . toLowerCase ( ) ) ; } }