export default class Env { sys : GlobalSystemInfo ; iOS = this . cache ( ( ) => /ios/ . test ( this . sys . system . toLowerCase ( ) ) , ( ) => this . sys . system ) ; constructor ( sys ) { this . sys = sys ; } cache < T extends ( ... args : any [ ] ) => any > ( self , identifier ? ) { const store = new Map ( ) ; return function ( ) { const args = [ ... arguments ] as ArgsType < T > ; const id = identifier ? identifier ( ... args ) : args [ 0 ] ; let cache = store . get ( id ) ; if ( ! cache ) store . set ( id , ( cache = self ( ... args ) ) ) ; return cache ; } as T ; } }