export const useLess = < T > ( value ) : T => value ; export const useNumber = ( x ) : number => useLess ( x ) ; export const use0 = ( ) : 0 => useLess ( 0 ) ; export const use1 = ( ) : 1 => useLess ( 1 ) ; export const use2 = ( ) : 2 => useLess ( 2 ) ; export const use3 = ( ) : 3 => useLess ( 3 ) ; export const use4 = ( ) : 4 => useLess ( 4 ) ; export const use5 = ( ) : 5 => useLess ( 5 ) ; export const use6 = ( ) : 6 => useLess ( 6 ) ; export const use7 = ( ) : 7 => useLess ( 7 ) ; export const use8 = ( ) : 8 => useLess ( 8 ) ; export const use9 = ( ) : 9 => useLess ( 9 ) ; export const use10 = ( ) : 10 => useLess ( 10 ) ; export const usePlus = ( a , b ) : number => useLess ( useLess ( a ) + useLess ( b ) ) ; export const useMinus = ( a , b ) : number => useLess ( useLess ( a ) - useLess ( b ) ) ; export const useTimes = ( a , b ) : number => useLess ( useLess ( a ) * useLess ( b ) ) ; export const useDivide = ( a , b ) : number => useLess ( useLess ( a ) / useLess ( b ) ) ; export const usePower = ( a , b ) : number => useLess ( Math . pow ( a , b ) ) ; export const usePowerOfTwo = ( n ) : number => useLess ( Math . pow ( 2 , n ) ) ; export const useTrue = ( ) : true => useLess ( true ) ; export const useFalse = ( ) : false => useLess ( false ) ; export const useCondition = < T extends true | false > ( value ) : T => useLess ( value ) ; export const useAnd = ( a , b ) : boolean => useLess ( a && b ) ; export const useOr = ( a , b ) : boolean => useLess ( a || b ) ; export const useXOr = ( a , b ) : boolean => useLess ( ( a && ! b ) || ( b && ! a ) ) ; export const useTernary = < T > ( condition , valueIf , valueElse ) : T => useLess ( condition ? valueIf : valueElse ) ; export const useUndefined = ( ) : undefined => useLess ( undefined ) ; export const useNull = ( ) : null => useLess ( null ) ; export const useString = ( s ) : string => useLess ( s ) ; export const useConcat = ( s1 , s2 ) : string => useLess ( useLess ( s1 ) + useLess ( s2 ) ) ; export const useStringLength = ( s ) : number => useLess ( useLess ( s ) . length ) ; export const useObject = < T extends object > ( obj ) : T => useLess ( obj ) ; export const useArray = < T > ( arr ) : T [ ] => useLess ( arr ) ; export const useObjectProperty = < T , K extends keyof T > ( obj , key ) : T [ K ] => useLess ( obj [ key ] ) ; export const useArrayItem = < T > ( arr , key ) : T => useLess ( arr [ key ] ) ; export const useMap = < T , U > ( arr , fn ) : U [ ] => useLess ( arr . map ( fn ) ) ; export const useFilter = < T > ( arr , fn ) : T [ ] => useLess ( arr . filter ( fn ) ) ; export const useReduce = < T , V > ( arr , fn , init ) : V => useLess ( arr . reduce ( fn , init ) ) ;