param string export function hash ( string ) { let out = 2166136261 ; let i = 0 ; let len = string . length ; for ( ; i < len ; ++ i ) out = ( out ^= string . charCodeAt ( i ) ) + ( out << 1 ) + ( out << 4 ) + ( out << 7 ) + ( out << 8 ) + ( out << 24 ) ; return ( out >>> 0 ) . toString ( 36 ) ; } const minL = /(^|[:;,{}\s])\s+|$/g ; const minR = / +{/g ; export function safeHash ( key , hashFn ) { const hashCache = new Map < string , string > ( ) ; let value ; return ( string ) => { if ( ( value = hashCache . get ( string ) ) ) return value ; value = hashFn ( string . replace ( minL , "$1" ) . replace ( minR , "{" ) ) ; hashCache . set ( string , ( value = ! key && ! isNaN ( value [ 0 ] as any ) ? "_" + value : value ) ) ; return value ; } ; } export function noop ( ) { }